feat(css): support CSS import and asset URL externals - #15431
Conversation
📦 Binary Size-limit
❌ Size increased by 4.00KB from 68.33MB to 68.33MB (⬆️0.01%) |
Rsdoctor Bundle Diff Analysis
Found 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
Merging this PR will improve performance by 2.45%
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
|
@codspeedbot is this regression real ? |
No — this one is a measurement artifact, not a real regression. No code change needed. What the numbers actually are
Where the +76 µs lives Comparing the two flamegraphs, every user-code subtree is flat (identical to the tenth of a µs), with identical call counts:
The entire delta is inside mimalloc: the aggregated Corroborating evidence
Conclusion: safe to acknowledge the regression on CodSpeed. If you want extra confidence, a re-run of the same head commit will typically land on the other rung of the main band. Summary
Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
asset,asset-url, andcss-importto the publicExternalsTypeoptionsasset-urlwhen it is consumed by CSSurl(), while keeping JavaScriptnew URL()behavior asassetSourceType::CssUrltoSourceType::AssetUrlStringEnumwith:rename_allrules, withsnake_caseas the default and per-variantrenametaking precedenceSourceTypestring mappings withrename_all = "kebab-case"configCases/externals/asset-urlcoverageThe deprecated webpack
css-urlalias is intentionally not supported.Example
Given:
Rspack now keeps the external URL in the emitted CSS. Before this fix, the external was treated as a JavaScript source and could not be generated correctly for the CSS consumer.
The new
StringEnumforms keep mappings concise and custom source types round-trippable:Unknown strings are converted to
Custom(value), andas_str()returns the preserved value.Validation
pnpm run build:binding:devpnpm run test -t 'externals/asset-url'pnpm run test -t 'custom-url'pnpm run test -t 'css/import'cargo test -p rspack_macros_testcargo clippy -p rspack_macros -p rspack_macros_test -p rspack_core -p rspack_plugin_asset -p rspack_plugin_externals --all-targets -- -D warningscargo fmt --all -- --checkconfigCases/css/importandconfigCases/externals/asset-urlChecklist
css-urlis not exposedby OpenAI Codex