2

I'm looking for a way to use the 6to5 transpiler in my grunt build process, while still being able to map any minified files of the ES5 output back to the original ES6 source files.

The grunt-6to5 plugin only has a boolean sourceMap option, which of course generates .map files mapping back to the ES5 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.

Is there any way to accomplish what I'm trying to do?

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
  • Did you find a solution for this problem? I have the same problem. And I have browserify in my toolchain as well... – dsuckau May 12 '15 at 12:13
  • 1
    Well, kind of; after this (https://github.com/babel/grunt-babel/issues/15), I switched to gulp: http://stackoverflow.com/questions/28087674/gulp-browserify-6to5-source-maps –  May 12 '15 at 20:30
  • So, you transpil your ES6 to ES5 with babel(ify), after that you browserify it and then you uglify it? And your source maps map back to the original ES6 code? (just for my understanding) Yesterday evening I got it almost working with grunt. I see the original code in Firefox, Chrome and IE11. But only in Chrome the breakpoints are working. How about your solution? Works the same in all browsers? – dsuckau May 13 '15 at 07:48
  • Okay, I tried. It works better than with grunt generated sourcemaps. In IE11 you can only set breakpoints on statements that are known by ES5 as well. You can not set a breakpoint for "import" or "class", but for "return" or "var". That seems to be a limitation of IE11, but okay. Thank you! – dsuckau May 13 '15 at 11:07

0 Answers0