1

I have the following gulp task:

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']);
});

When I go to the build folder and see the built file. It contains full paths of some js files. How do prevent that?

Alexander Suraphel
  • 10,103
  • 10
  • 55
  • 90
  • I had a similar issue here-http://stackoverflow.com/questions/30227862/browserify-and-reactify-source-maps-include-full-local-path-names . I never really resolved it but I suspect in my case it was because of reactify. I ended up switching to webpack. – Dave Pile Jul 08 '15 at 07:17
  • @DavePile really? I spend the whole day to fix this!! So you're positive there's not solution for this now? – Alexander Suraphel Jul 08 '15 at 07:21
  • No I am not positive. There may be a solution but I dont know it :) I spent a similar amount of time. The reason I think it was reactify is because I set up a test project without jsx, only js files and when I pass them through reactify i get full paths in the chrome debugger, when I dont use reactify i dont get full paths. You can see this in my question. The answer I marked as correct, initially i thought it worked but when I came back it wasnt working so I am now unsure if i didnt test it properly or some other problem came up later. Anyway, I find a few extra benefits in webpack as well – Dave Pile Jul 08 '15 at 07:27
  • @DavePile Great. I don't want to waste time on this. So you think I'll be okay with webpack? I'm new to these tools. – Alexander Suraphel Jul 08 '15 at 07:32
  • 1
    I was hesitant at first because there always seems to be some new tool you have to learn but it is pretty good. good luck – Dave Pile Jul 08 '15 at 07:49
  • @DavePile Thanks a lot! – Alexander Suraphel Jul 08 '15 at 08:18

0 Answers0