Browselify Babelify Uglify source map sources do not load in Google Chrome

I generated the js file with the source map using the following gulp task. Source sources are loaded in Firefox, but not loaded in Chrome. Can someone point out why Chrome cannot find sources that are explicitly included in the generated index - [hash] .js.map?

gulp.task('browserify', function () {
  // set up the browserify instance on a task basis
  return browserify({ debug: true })
    .transform(babelify)
    .require('client/web/private/js/es6/index.js', { 
      entry: true 
    })
    .bundle()
    .on('error', function handleError(err) {
      console.error(err.toString());
      this.emit('end');
    })
    .pipe(source('index.js'))
    .pipe(buffer())
    .pipe(sourcemaps.init({ 
      loadMaps: true 
    }))
      // Add transformation tasks to the pipeline here.
      .pipe(uglify())
      .pipe(rev())
    //   .on('error', gutil.log)
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest('./client/web/public/dist/js'))
});
+2
source share

Source: https://habr.com/ru/post/1619739/


All Articles