bundle the code using webpack, creating ES5 files (w/ sourcemaps) in app/assets/javascripts
sprockets then fingerprints and uglifies these ES5 files during the compile step.
However, the initial source maps generated by webpack for the ES5 code don't get parsed and therefore the uglified version contains source maps only to the bundled ES5 code, not to the original ES6 code.
Context
We write ES6 and
import
npm modules using webpack and https://github.com/shakacode/react_on_railsThis means that we
node_modules/
app/assets/javascripts
However, the initial source maps generated by webpack for the ES5 code don't get parsed and therefore the uglified version contains source maps only to the bundled ES5 code, not to the original ES6 code.
Suggestion
https://github.com/lautis/uglifier/blob/master/spec/source_map_spec.rb#L97 allows for an input source map file (but doesn't seem to support inlined source maps).
So would it be possible to create these ES5 and map files in
app/assets/javascripts
And have this gem add the input source map if it detects the presence of a file with [name].js.map ?