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
bug #20 [Manifest] Drop async chunk CSS from the Vite manifest (Kocal)
This PR was merged into the main branch.
Discussion
----------
[Manifest] Drop async chunk CSS from the Vite manifest
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix#18
| License | MIT
## What
Async (non-entry) chunk CSS is no longer written to the Vite manifest. For example, `build/map_controller.css` for the ``@symfony`/ux-leaflet-map` lazy controller's stylesheet used to get a manifest entry; it doesn't anymore.
## Why
That CSS is loaded at runtime by the bundler itself when the lazily-imported chunk is pulled in. Twig's `asset()` never looks it up, so the manifest entry was just a byproduct, and a harmful one: it diverged from Rsbuild, which never listed these files in the first place, and it could collide when two async chunks shared a name. A local `map_controller` Stimulus controller and the ``@symfony`/ux-leaflet-map` package's `map_controller` both produce a `build/map_controller.css`, so one silently overwrote the other in the manifest.
## Kept
Entry CSS is untouched (rendered through entrypoints.json / the link tags, keyed by a unique entry name like `build/app.css`), and imported assets are untouched (path-keyed since #17). The async chunk's CSS file is still emitted to disk, it just no longer gets a manifest key.
Verified in the playground: `build/map_controller.css` is gone from the Vite manifest, entry and imported-asset keys are unchanged. Vite now matches Rsbuild here.
## Testing
Unit tests on the collector (async chunk CSS dropped, two same-named async chunks producing no colliding key, entry CSS kept) plus an integration test where an entry lazily imports a module with its own CSS, asserting it's absent from both the Vite and Rsbuild manifest while still emitted on disk.
Commits
-------
2b733f0 [Manifest] Drop async chunk CSS from the Vite manifest
0 commit comments