Open ramasilveyra opened 7 years ago
In general I feel that tools should not know anything about prior transformations — it means that every single step in a build pipeline has to reimplement the same logic, and insodoing significantly increases surface area for bugs.
For example, Rollup will compose sourcemaps from multiple chained transformer plugins without those plugins having to know anything about each other. Each plugin just describes the transformations it implements. I'd assumed that webpack would do something similar (cc @TheLarkInn!)
See also sorcery, which combines sourcemaps from multiple transformations.
Hello! Great work with butternut!
I was trying to add sourcemaps support to
butternut-webpack-plugin
(https://github.com/Apercu/butternut-webpack-plugin/pull/2) but I dont know how to pass a sourcemap.Maybe something like what babel does will be good:
https://babeljs.io/docs/usage/api/#babel-transform-code-string-options-object- https://babeljs.io/docs/usage/api/#options
Also Im not sure if this is the right place for this request, maybe it should be in https://github.com/Rich-Harris/magic-string ?