Is it possible to pass a flag to Gulp to have it run tasks in different ways?

Normally in Gulp tasks look like this: gulp.task(‘my-task’, function() { return gulp.src(options.SCSS_SOURCE) .pipe(sass({style:’nested’})) .pipe(autoprefixer(‘last 10 version’)) .pipe(concat(‘style.css’)) .pipe(gulp.dest(options.SCSS_DEST)); }); Is it possible to pass a command line flag to gulp (that’s not a task) and have it run tasks conditionally based on that? For instance $ gulp my-task -a 1 And then in my gulpfile.js: … Read more

How to run Gulp tasks sequentially one after the other

in the snippet like this: gulp.task “coffee”, -> gulp.src(“src/server/**/*.coffee”) .pipe(coffee {bare: true}).on(“error”,gutil.log) .pipe(gulp.dest “bin”) gulp.task “clean”,-> gulp.src(“bin”, {read:false}) .pipe clean force:true gulp.task ‘develop’,[‘clean’,’coffee’], -> console.log “run something else” In develop task I want to run clean and after it’s done, run coffee and when that’s done, run something else. But I can’t figure that out. … Read more

Stylesheet not loaded because of MIME-type

I’m working on a website that uses gulp to compile and browser sync to keep the browser synchronised with my changes. The gulp task compiles everything properly, but on the website, I’m unable to see any style, and the console shows this error message: Refused to apply style from ‘http://localhost:3000/assets/styles/custom-style.css’ because its MIME type (‘text/html’) … Read more

How to fix “ReferenceError: primordials is not defined” in Node.js

I have installed Node.js modules by ‘npm install’, and then I tried to do gulp sass-watch in a command prompt. After that, I got the below response. [18:18:32] Requiring external module babel-register fs.js:27 const { Math, Object, Reflect } = primordials; ^ ReferenceError: primordials is not defined I have tried this before gulp sass-watch: npm … Read more

NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year. The community reviewed whether to reopen this question 6 months ago and left it closed: Original close reason(s) were … Read more