gulp - Why dependency files still included after using Browserify -
all:
i pretty new gulp , browserify, did transpile jsx code , browserify them bundle.js file.
var gulp = require("gulp"); var browserify = require("browserify"); var source = require("vinyl-source-stream"); var reactify = require("reactify"); gulp.task("default", function(){ browserify({ entries: ["js/app.js"], debug: true }) .transform(reactify) .bundle() .pipe(source("bundle.js")) .pipe(gulp.dest("dist/js/")); });
in app.js, specify few require dependencies(each 1 may require other file), , thought browserify parse them , compile single bundle.js file, when run it, include bundle.js in index.html page, still includes dependency files when check in chrome source tab, i wonder if chrome's feature parse bundle file gives me list of dependency file list or download dependency files well( confuse can click , open dependency files, guess chrome download them bundle.js, not sure that)?
thanks
if understand correctly, describing debug: true
in browserify gives you, aka source maps.
--debug -d enable source maps allow debug files separately.
and
when opts.debug true, add source map inline end of bundle. makes debugging easier because can see original files if in modern enough browser.
Comments
Post a Comment