fix(plugin/assets-retry): addQuery and switchDomain should work in async css chunk#4315
fix(plugin/assets-retry): addQuery and switchDomain should work in async css chunk#4315chenjiahan merged 9 commits intomainfrom
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
| (originSource) => | ||
| originSource.replace( | ||
| 'var fullhref = __webpack_require__.p + href;', | ||
| 'var fullhref = __webpack_require__.rsbuildLoadStyleSheet ? __webpack_require__.rsbuildLoadStyleSheet(href, chunkId) : (__webpack_require__.p + href);', |
There was a problem hiding this comment.
This seems to be an unsafe replacement, if the source code has changed, this replacement may not work or may break the original code.
There was a problem hiding this comment.
there is no better solution at present, it is a part of ancient runtime code from mini-css,
if changed in rspack, eco-ci would take effect for this
There was a problem hiding this comment.
This feature relies on css-extract, so it meets expectations and will have a higher dependence on css-extract, even if I don't use the replace method, any changes to css-extract runtime will have an influence to assets-retry
There was a problem hiding this comment.
Okay, let's keep track of the impact of runtime code changes through our ecosystem-ci.

Summary
fix
When I implemented this plugin, rsbuild was just switched from
experiment.csstocssExtractPluginexperimentally, I didn't know much about cssExtract.after this change, it means that
plugin-assets-retrycan only be used together withrspack.CssExtractPluginand MiniCssExtractPlugin in webpack😂 by the way, it was also not implemented in "eden"
Related Links
close #4306
Checklist