-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Source maps are lost during bundling. #401
Comments
Would love assistance on this, if you know how to get the tools to knock out the right map files. :) |
It may be as simple as adding Either way, I recommend adding |
Is this still an issue in v5? If so, anyone who can demonstrate how to fix it, let me know. Otherwise I may close this soon. Thanks! :) |
Looking at https://github.com/ethers-io/ethers.js/blob/master/tsconfig.package.json, the answer appears to be "yes this is still an issue" since that is still missing the source maps flag. I can't say whether that alone will fix it (I believe you use a bundler, which needs to do the right thing with the source TS source maps), but I can say with quite a bit of confidence that without the fix I described above, you definitely won't have functional source maps. |
I believe this should be fixed now. Source maps are carried through the build process and with the aid of Let me know if your milage differs, otherwise I'll close this. :) |
I'm not using ethers.js in any projects at the moment, so I cannot test myself. It may be worth also adding https://www.staging-typescript.org/tsconfig#declarationMap as well to improve developer experience (it is a relatively new addition to TS), but that is unrelated to the source map problem. |
I've added declaration maps in 5.0.27. If you have any issues, please let me know. :) |
The sourcemap for
ethers.min.js
is not the original easy-to-read TypeScript, but instead the compiled TypeScript output. The build system appears to be dropping the TypeScript sourcemap when minifying/bundling down toethers.min.js
. It would be nice if the build system kept the original TypeScript in the source map instead.I think most major build tools know how to merge sourcemaps, so if you are generating TS source maps the bundler/minifier should be able to turn those into a single bundled source map. Of course, the process is different for every bundler.
The text was updated successfully, but these errors were encountered: