Comments (11)
This might be helpful for you - https://www.npmjs.com/package/gulp-plumber
from gulp-postcss.
@11bit @matchabros It's gulp issue. Where it catches only last pipe error. I decide it with
gulp.task('css', function (done) {
return gulp.src(...)
// not last pipe
.pipe(postcss(...))
.on('error', done)
// Last pipe error will be caught
.pipe(gulp.dest(...))
})
from gulp-postcss.
@matchabros @TrySound Thanks guys. Anyway gulp 4 is going to bring a new error handling. I hope it won't need to use plumber of custom error handling no more.
from gulp-postcss.
I've tried using gulp-plumber
for this unfortunately it still stops compilation on every single fail.
gulp.task('css', function () {
var processors = [
atImport,
simplevars,
map(opts),
nestedcss,
colorFunction,
ms,
lost,
autoprefixer({browsers: ['last 1 version', 'ie 10']})
];
return gulp.src('./css/main.css')
.pipe( plumber() )
.pipe( sourcemaps.init() )
.pipe( postcss(processors) )
.pipe( rucksack() )
// .pipe( nano() )
.pipe( sourcemaps.write('.') )
.pipe( gulp.dest('build/css/') )
.pipe( browserSync.stream({match: "**/*.css"}) );
// .pipe( browserSync.reload({stream: true, match: "**/*.css"}) );
});
from gulp-postcss.
@lmartins plumber is ugly hack. You can see here in case how I organize my build process.
from gulp-postcss.
Thanks @TrySound, will study your example :)
from gulp-postcss.
@lmartins your issue might be coming from not using an error handler with gulp-plumber.
I just had a look myself and got rid of my errorHandler inside of .pipe(plumber())
and it does stop compiling on an error.
Here's the errorHandler I use in my build.
function errorAlert(err) {
$.notify.onError({
title: 'Gulp Error',
message: 'An error occured, check your terminal',
sound: 'Basso'
})(err);
gutil.log(gutil.colors.red(err.toString()));
this.emit('end');
}
from gulp-postcss.
@matchabros The problem is that for CI this code won't exit with error code.
from gulp-postcss.
@TrySound Pardon me if my lack of knowledge will come out right now, but could you elaborate on what you meant ?
from gulp-postcss.
@matchabros If you use something like travis ci,this.emit('end')
will end task but without error. It will just passes by with some log.
from gulp-postcss.
@TrySound I see, thanks for taking a moment and explaining.
from gulp-postcss.
Related Issues (20)
- Error in plugin "gulp-postcss" HOT 1
- PostCSS 8 support HOT 9
- Extension css for output HOT 2
- PostCSS plugin autoprefixer requires PostCSS 8. Update PostCSS or downgrade this plugin HOT 6
- Use postcss-load-config 3.0
- Error: [object Object] is not a PostCSS plugin HOT 1
- CSS Syntax Error, alien script, and ELIFECYCLE error on build HOT 9
- Sourcemaps always shows parent line for nested SASS HOT 1
- Support "watch" mode (equivalent to -w switch in postcss-cli) HOT 6
- PostCSS dependency messages are not respected HOT 2
- Error: PostCSS plugin autoprefixer requires PostCSS 8. HOT 3
- Outputing multi-level folders HOT 1
- Error plugin is not a function HOT 2
- Not working with TailwindCSS >=3.0 HOT 1
- CssSyntaxError in plugin "gulp-postcss" / You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser HOT 1
- TypeError in plugin "gulp-postcss" plugin is not a function HOT 1
- ENOENT: No such file or directory (sass/postcss/tailwind)
- s.default.isPseudoElement is not a function HOT 1
- Update `postcss-load-config` HOT 1
- Why does the new version 9.1.0 not comply with semver about engines.node? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-postcss.