Skip to content

Conversation

colinaaa
Copy link
Collaborator

@colinaaa colinaaa commented Oct 6, 2025

Summary

Port webpack/webpack#19824.

A new extractSourceMap option has been added to extract existing source map data from files.

This is used to replace source-map-loader.

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link

netlify bot commented Oct 6, 2025

Deploy Preview for rspack canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 79b3251
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/68ece51c0be3260008ce3763

@github-actions github-actions bot added the release: feature release: feature related release(mr only) label Oct 6, 2025
fs: &Arc<dyn ReadableFileSystem>,
) -> Result<Option<Content>> {
let scheme = resource_data.get_scheme();
if scheme.is_none()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is moved from crates/rspack_loader_runner/src/runner.rs, which is the same as webpack: https://github.com/webpack/webpack/blob/9f98d803c0c5011188901e895a7060ab06e12f80/lib/schemes/FileUriPlugin.js#L39-L48

Copy link

codspeed-hq bot commented Oct 6, 2025

CodSpeed Performance Report

Merging #11814 will not alter performance

Comparing colinaaa:colin/1006/extract-source-map (79b3251) with main (a915dab)

Summary

✅ 17 untouched

@xiaoxiaojx
Copy link

@colinaaa There’s a related feature— extractSourceMap supports HTTP URLs. If there’s a future plan for it, it could be ported as well.

@colinaaa
Copy link
Collaborator Author

@colinaaa There’s a related feature— extractSourceMap supports HTTP URLs. If there’s a future plan for it, it could be ported as well.

Thanks! I've noticed that, too. I would like to port that in the next PRs.

@colinaaa colinaaa marked this pull request as ready for review October 13, 2025 01:42
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

@chenjiahan chenjiahan requested a review from SyMind October 13, 2025 08:00

it("should extract source map - 1", () => {
const fileData = fs.readFileSync(path.resolve(__dirname, "bundle1.js.map")).toString("utf-8");
const fileData = fs.readFileSync(__filename + ".map").toString("utf-8");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests have been updated in webpack/webpack#20008.

expect(link.sheet.css).toContain("/*# sourceMappingURL=bundle0.css.map*/");
}

expect(css).toMatchSnapshot();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot get correct snapshot in WASM tests. And we have different snapshot with Webpack.

@colinaaa
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

@colinaaa
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

@colinaaa
Copy link
Collaborator Author

@codex review

Copy link

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add support for extractSourceMap

2 participants