即使fullPaths设置为false,Browswerify也会编译为完整路径

时间:2015-07-08 07:10:51

标签: javascript npm gulp browserify commonjs

我有以下gulp任务:

var source = require('vinyl-source-stream'),
    gulp = require('gulp'),
    browserify = require('browserify'),
    reactify = require('reactify'),
    notify = require('gulp-notify');

var sourcesDir = './react',
    appEntryPoint = "req.jsx",
    targetDir = './build';


gulp.task('default', function() {
  return browserify({entries: [sourcesDir + '/' + appEntryPoint], fullPaths:false, debug: true})
    .transform(reactify)
    .bundle()
    .pipe(source(appEntryPoint))
    .pipe(gulp.dest(targetDir))
    .pipe(notify("Bundling done."));
});

gulp.task('watch', function() {
  gulp.watch(sourcesDir + '/' + "*.jsx", ['default']);
});

当我转到构建文件夹并查看构建的文件时。它包含一些js文件的完整路径。怎么防止这个?

0 个答案:

没有答案