-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 sources
are relative to root instead of to .map
file
#1255
Comments
swc_ecma_parser: - Fix generic parsing issue in jsx context. (#1299) swc_ecma_transforms_module: - Allow importing a module multiple time. (#1232) - Handle imports in the constructor of an exported class decl. (#1213) swc: - Respect `sourceMappingURL`. (#1236) - Resolve `sourceMappingURL` relative from file. (#1255) - Respect `isModule: false` (#1258) spack: - Support loading json files. (#1225)
@kdy1 Is this fixed in version 1.2.47? I just tried it, and the bug seems to be present there. |
@jsedlacek Hmm... I thought I fixed it, but maybe I made a mistake. |
I found that being relative to the output source file requires knowing the destination path of sourcemap.
This seems like a bad design. The function named I'll postpone this issue to think about it more. |
@kdy1 Apologies for being a bit impatient... Any updates on this, any way I could help? This is the remaining big reason we're holding off to move our project over from babel to swc :( |
@pbadenski |
swc: - Use `output_path` to make sourcemap path relative to the `.map` file. (#1255)
This will be fixed as of v1.2.64 |
Is there anything special I need to have this work with I tried both The difference seems to be that source map in babel is:
and in swc it's:
|
I think it's an issue of |
Correction - it looks like this works now, but lines aren't correct in the source maps, I'll submit a separate issue for that. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Describe the bug
Source map
sources
are related to root instead of to.map
file.I have source (Typescript) files inside the
src
folder and generate (javascript) into thebuild
folder using:The
build/index.js.map
contains:When compiled via
tsc
, the result is:Input code
src/index.ts:
Config
Expected behavior
The
source
reference is relative to the.map
file.Version
The version of @swc/core:
1.2.40
Additional context
Because of this, the VS Code is not able to add a breakpoint in the
.ts
file when debugging.The text was updated successfully, but these errors were encountered: