-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: Fix the problem that the inline sourcemap file reports an error … #7002
Conversation
197c732
to
dd7c572
Compare
I'm not going to accept this PR, as there's |
@kdy1 when the sourcemapUrl of the source file is file, setting InputSourceMap::Str("inline") will report an error: At the same time, the setting of babel does not need to distinguish between true and inline, can we be more automated |
It's expected |
Why do you expect external source map to work when you give |
I just want to be able to automatically process |
I agree with @limerickgds here. It's cumbersome to know beforehand whether the file has an inline or external source map without inspecting it. We shouldn't force the user to know that, it should just be a boolean "allow input maps" or "ignore input maps" and let SWC figure out whether it's inline or external. This is how Babel does it (technically, they also allow you to manually pass a |
@kdy1 @jridgewell thank you for your understanding |
Sorry, I didn't know that babel supports both on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swc-bump:
- swc
@kdy1 https://babeljs.io/docs/options#inputsourcemap This is the babel configuration. There is no need to support |
Yes, I know and I don't want to make a breaking change at the moment, and even if it's the case, it should be another PR. |
I think for the time being, just treating the two options as equivalent and supporting both inline and external for both is the right decision. |
It sounds good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you address #7002 (comment) too?
My understanding is that |
Yes, exactly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the lockfile and preset-env data
…when inputSourceMap is set to true
379f8aa
to
765aa68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
…when inputSourceMap is set to true
Description: When I configure InputSourcemap to true in the project, swc can only handle sourcemapurl of file type, and if I set it to inline, swc can only handle inline, otherwise an error will be reported. I hope that swc can recognize the content of sourcemapurl instead of requiring me to decide what configuration should be set based on the content in source content.Similar to babel's processing method
BREAKING CHANGE: false
Related issue (if exists):