You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Native CSS skips async stylesheet when it is initial in another entry sharing the runtime #15858
With native CSS (type: 'css', parser.exportType: 'link'), multiple entries, optimization.runtimeChunk: 'single', and a shared CSS chunk, a dynamic import can resolve without loading its required stylesheet.
The stylesheet is initial for a different entry in the same compilation. That other entry is not loaded on the current page. The generated shared runtime nevertheless initializes the stylesheet's chunk as loaded in cssInstalledChunks.
It's unclear to me whether this is a known missing feature of the builtin CSS support. It came up for me when I tried to refactor the css-loader out which was archived recently.
Expected behavior
The dynamic import requests the shared stylesheet and waits for it to load before resolving.
Actual behavior
The import resolves without requesting the stylesheet. The CssExtractRspackPlugin control with the same shared runtime works correctly.
Native CSS with a separate runtime per entry also.
main dynamically imports feature.js, which imports feature.css.
other uses feature.js as its entry.
An enforced split-chunk group puts feature.css into shared-css.
Only main's initial entry assets are included on the page.
Validation
The standalone automated check executes emitted JavaScript with a simulated DOM; it verifies CSS requests and import-promise timing, not browser rendering. The attached project also includes real browser pages for visual confirmation.
Activity