Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I view source maps with Angular and Browserify?

I am trying to step into the Browserify world. I am using a this tutorial as a starter. The source maps work fine. As soon as I require in angular the source maps disappear. Here is my browserify task.

gulp.task('browserify', function(){
    return browserify({
            entries: ['./src/javascript/app.coffee'],
            extensions: ['.coffee', '.hbs']
        })
        .bundle({debug: true})
        .on('error', handleErrors)
        .pipe(source('app.js'))
        .pipe(gulp.dest('./build/'));
});

I am passing in the debug: true flag. Is it even possible to make source maps with angular?

like image 264
jhamm Avatar asked Aug 13 '26 03:08

jhamm


1 Answers

I believe you have the debug flag in the wrong location, try moving it into the call to browserify().

gulp.task('browserify', function(){
    return browserify({
            entries: ['./src/javascript/app.coffee'],
            extensions: ['.coffee', '.hbs'],
            debug: true //moved to here
        })
        .bundle()
        .on('error', handleErrors)
        .pipe(source('app.js'))
        .pipe(gulp.dest('./build/'));
});
like image 104
pgreen2 Avatar answered Aug 15 '26 01:08

pgreen2



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!