-
Notifications
You must be signed in to change notification settings - Fork 519
rollup_bundle
loses sourcemap context due to running tsc for downleveling
#175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Right, typescript is a broken downleveler for generated inputs. |
After discussion with @IgorMinar we feel that the correct path should be:
|
rollup_bundle
rule does not correctly retain source maps.rollup_bundle
loses sourcemap context due to running tsc for downleveling
I fixed this for One option is to make downleveled-ESM an official third output flavor from Another option is to push on microsoft/TypeScript#13944 so that TypeScript can be used to downlevel generated JS files. Another option is to find some other toolchain that does all these steps and handles sourcemaps correctly. I haven't heard this requested from anyone so I think this issue is low priority. |
|
@alexeagle I'm wary of the combinatorial explosion of emit modes, both for
reasons of complexity but also bazel memory usage etc. I think we ought to
be able to make do with two modes (development mode and production mode).
As Connor says, maybe this is more of a problem with our final
downlevelling/bundling tool?
microsoft/TypeScript#13944 tracks tsc support for
input source maps.
|
Good timing @connorjclark I just checked in a test yesterday that the new rollup/terser rules compose sourcemaps correctly. Should have closed this issue as part of #1181 Note, we did switch from tsc to babel as the "downlevel" step here, but note that the feature now lives entirely in user-space - we don't have a babel rule or any interop with it. We are working to add the proper JS provider so that TypeScript outputs play correctly with rollup_bundle and other rules. |
Uh oh!
There was an error while loading. Please reload this page.
Here is my understand of how
rollup_bundle
works:bundles.es6
directorybundles.es6
directory intobundle.es6.js
filebundle.js
usingtsc
bundle.min.js
The pipeline above works fine for the source code, but it brakes source map. There are 2 issues:
*.js.map
as output of the action. This can be easily fixed as shown heretsc
is used to downlevel the code from ES2015->ES5tsc
assumes thatbundle.es6.js
is the source file. This is incorrect assumption. Insteadtsc
should transform the source maps inbundel.es6.js
to the next step. I am not even sure iftsc
supports such mode. In any case the issue is that at this point the source map have been destroyed and so the subsequent source maps are of no value.The text was updated successfully, but these errors were encountered: