function rebundle() {
    var stream = bundler.bundle()
      .on('error', gutil.log)
      .pipe(source(bundleName))
      .pipe(buffer());

    if (production.isSet()) {
      stream = stream

        // Load Browserify's inline sourcemaps
        .pipe(sourcemaps.init({loadMaps: true}))

        // Minimization
        .pipe(uglify({
          output: {
            "ascii_only": true
          }
        }))

        // For prod, MD5 hash final file and write to manifest
        .pipe(rev())

        // Write sourcemap to external file
        .pipe(sourcemaps.write("./"))

        .pipe(gulp.dest(outDir))
        .pipe(rev.manifest(
          "css-" + randomstring.generate(7) + ".manifest.json"
        ));
    }

    return stream.pipe(gulp.dest(outDir));
  }
// Gets called on update, triggers rebundle
Gets called on update, triggers rebundle
Gets called on update triggers rebundle
function rebundle() {
    var stream = bundler.bundle()
      .on('error', gutil.log)
      .pipe(source(bundleName))
      .pipe(buffer());
    if (production.isSet()) {
      stream = stream
        .pipe(sourcemaps.init({loadMaps: true}))
        .pipe(uglify({
          output: {
            "ascii_only": true
          }
        }))
        .pipe(rev())
        .pipe(sourcemaps.write("./"))
        .pipe(gulp.dest(outDir))
        .pipe(rev.manifest(
          "css-" + randomstring.generate(7) + ".manifest.json"
        ));
    }
    return stream.pipe(gulp.dest(outDir));
  }
function rebundle ( ) { var stream = bundler . bundle ( ) . on ( 'error' , gutil . log ) . pipe ( source ( bundleName ) ) . pipe ( buffer ( ) ) ; if ( production . isSet ( ) ) { stream = stream . pipe ( sourcemaps . init ( { loadMaps : true } ) ) . pipe ( uglify ( { output : { "ascii_only" : true } } ) ) . pipe ( rev ( ) ) . pipe ( sourcemaps . write ( "./" ) ) . pipe ( gulp . dest ( outDir ) ) . pipe ( rev . manifest ( "css-" + randomstring . generate ( 7 ) + ".manifest.json" ) ) ; } return stream . pipe ( gulp . dest ( outDir ) ) ; }
Gets called on update, triggers rebundle
Gets called on update triggers rebundle
// Load Browserify's inline sourcemaps // Minimization // For prod, MD5 hash final file and write to manifest // Write sourcemap to external file