Gulp.js event stream merge order

Try streamqueue. var streamqueue = require(‘streamqueue’); gulp.task(‘css’, function () { return streamqueue({ objectMode: true }, gulp.src([‘dev/css/reset.css’, ‘dev/css/style.css’, ‘dev/css/typography.css’, ‘dev/css/sizes.css’]), gulp.src([‘dev/css/*.scss’]).pipe(sass()) ) .pipe(concat(‘main.css’)) .pipe(minifyCSS()) .pipe(gulp.dest(‘build/css’)) }); This cheatsheet will help you. PDF is here.

Gulp doesn’t work

This error message indicates that the module ‘del’ cannot be found. It seems that the ‘del’ package is not installed or not properly configured in your project. Try installing the ‘del’ package by running the following command in your terminal: npm install del –save-dev If you have already installed ‘del’ package and still getting this … Read more

Gulp condition inside pipe

Use the gulp-if plugin: var gulpif = require(‘gulp-if’); g.task(‘sass’, function() { return g.src(sources.sass) .pipe(changed(output.css)) .pipe(sass({style:’compressed’, sourcemap:true})) // Conditional output .pipe(gulpif(condition1, g.dest(output.css))) .pipe(gulpif(condition2, g.dest(output.css2))) .pipe(notify(‘scss converted to css and compressed <%= file.relative %>’)); });

Underscore in partial Sass file

1. Partials must start with an underscore if you do not want them to be generated into a css file. 2. A scss file can import another file without an underscore and still compile correctly. Take this example: sass +– base | +– _normalize.scss +– components | +– site-header.scss +– utilities | +– _icons.scss +– … Read more

Have sass-lint ignore a certain line?

Disabling through comments Update per December 2016 according to the docs this will now be possible using this syntax: Disable more than 1 rule for entire file // sass-lint:disable border-zero, quotes p { border: none; // No lint reported content: “hello”; // No lint reported } Disable a rule for a single line p { … Read more

Gulpjs combine two tasks into a single task

I think the proper way of doing this is using task dependency. In gulp you can define tasks that needs to be run before a given task. For instance: gulp.task(‘scripts’, [‘clean’], function () { // gulp.src( … }); When doing gulp scripts in the Terminal, clean is run before the scripts task. In your example … Read more

cannot find module “lodash”

Be sure to install lodash in the required folder. This is probably your C:\gwsk directory. If that folder has a package.json file, it is also best to add –save behind the install command. $ npm install lodash –save The package.json file holds information about the project, but to keep it simple, it holds your project … Read more