how to output multiple bundles with browserify and gulp

I don’t have a good environment to test this in right now, but my guess is that it would look something like: gulp.task(“js”, function(){ var destDir = “./dist”; return browserify([ “./js/app.js”, “./js/public.js” ]) .bundle() .pipe(source(“appBundle.js”)) .pipe(gulp.dest(destDir)) .pipe(rename(“publicBundle.js”)) .pipe(gulp.dest(destDir)); }); EDIT: I just realized I mis-read the question, there should be two separate bundles coming from … Read more

Gulp returns 0 when tasks fail

You need to ‘return gulp.src(…’ so that the task waits for the returned stream. EDIT Gulp tasks are asynchronous by nature. The actual task is not executed yet at the time of ‘gulp.src(…).pipe(…);’. In your example, the gulp tasks mark their results as success before the actual tasks are executed. There are some ways to … Read more

Iterating over directories with Gulp?

There’s an official recipe for this: Generating a file per folder var fs = require(‘fs’); var path = require(‘path’); var merge = require(‘merge-stream’); var gulp = require(‘gulp’); var concat = require(‘gulp-concat’); var rename = require(‘gulp-rename’); var uglify = require(‘gulp-uglify’); var scriptsPath=”src/scripts”; function getFolders(dir) { return fs.readdirSync(dir) .filter(function(file) { return fs.statSync(path.join(dir, file)).isDirectory(); }); } gulp.task(‘scripts’, function() … Read more

Mismatch in gulp local and CLI versions

I am answering my own question, just so it is useful for others. Is there a way to remove the global gulp version, but keep the project specific gulp? No. AFAIK, you are required to install gulp globally as well as one specific to your project. More info on gulp versions here. Why do we … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)