babel / grunt-babel

Grunt plugin for Babel
https://babeljs.io
MIT License
437 stars 70 forks source link

SourceMap not working with grunt-contrib-concat/grunt-contrib-uglify #89

Open nishantkmr opened 6 years ago

nishantkmr commented 6 years ago

The grunt-babel plugin generates the .map files mapping back to the ES6 source files but when trying to combine this with grunt-contrib-concat/grunt-contrib-uglify, I can only get a mapping back to the ES5 output, not to the original ES6 sources.

Waltari10 commented 6 years ago

Let me know if you found a solution for this. Thanks!

Waltari10 commented 6 years ago
      options: {
        sourceMap: true,
        inputSourceMap: grunt.file.readJSON(env.MINIFIED_FILE_PATH + env.MINIFIED_FILE_NAME + '.js.map')
      },

This should work.

rorysmorris commented 5 years ago

If anyone stumbles across this hoping for a solution, I suggest looking at Prayag Verma's answer here: https://stackoverflow.com/questions/32571058/grunt-babel-multiple-files-and-preserve-source-mapping

BenJamin's comment (and jsbin link) on this answer helps, too.