-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
add extractSourceMap option for modules #15523
base: main
Are you sure you want to change the base?
Conversation
For maintainers only:
|
a936c95
to
85efee7
Compare
7ede1d7
to
059faf8
Compare
059faf8
to
5931183
Compare
b06b19f
to
b1a7c37
Compare
@vankop Can you rebase too? Thank you |
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.
Besides these three changes, requested this looks good.
Also rebase needed. |
82bf50f
to
1539254
Compare
7444e32
to
a602d8c
Compare
@vankop Thanks for your update. I labeled the Pull Request so reviewers will review it again. @TheLarkInn Please review the new changes. |
ab23406
to
059380c
Compare
new WebpackError( | ||
`Failed to parse source map from '${sourceMappingURL}': ${parseError}` | ||
) | ||
); |
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.
Based on feedback during development of https://github.com/webpack-contrib/source-map-loader/, better to make an options for this, in real world a lot of packages have broken source maps and developer can't fix it in vendor libraries, so better generate a warning, because it really doesn't break a build, but allow to setup it to make an error, i.e.
type ExtractSourceMap = boolean | { errorSeverity: "none" | "warn" | "error" }
@@ -0,0 +1,3 @@ | |||
const a = 1; | |||
// comment | |||
//#sourceMappingURL=/a.map |
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.
Let's add a test for remote source maps, i.e. http://github.com/webpack/webpack/test/configCases/source-map/my-source-map.js.map
); | ||
} | ||
|
||
if (map.sources && map.sources.length > 0) { |
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.
Does we support sections
? like here https://github.com/webpack-contrib/source-map-loader/blob/master/src/index.js#L91 because I see them sometimes
return callback(null, input.replace(replacementString, ""), map); | ||
} | ||
); | ||
}; |
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.
Also let's implement https://github.com/webpack-contrib/source-map-loader/tree/master?tab=readme-ov-file#filtersourcemappingurl, sometimes some source maps are really broken and you can't do anything with them, so let's add:
type ExtractSourceMap = boolean | { errorSeverity: "...", test: Rules, include: Rules, Exlcude: Rules }
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.
Code look good, let's do small improvements
Just for infromation we have https://github.com/webpack-contrib/source-map-loader and it works great a lot of time, so maybe some optimizations and inspiration you can take from there |
What kind of change does this PR introduce?
feature
closes #10265
Did you add tests for your changes?
not yet
Does this PR introduce a breaking change?
no
What needs to be documented once your changes are merged?
deprecate
source-map-loader