Skip to content

Commit 26a613a

Browse files
helhumsapphi-red
andauthored
docs: reflect changes to manifest.json in migration.md (#15165)
Co-authored-by: 翠 / green <[email protected]>
1 parent 339b20c commit 26a613a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/guide/migration.md

+10
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ In Vite 4, the manifest files ([`build.manifest`](/config/build-options.md#build
134134

135135
From Vite 5, they will be generated in the `.vite` directory in the `build.outDir` by default. This change helps deconflict public files with the same manifest file names when they are copied to the `build.outDir`.
136136

137+
### Corresponding CSS files are not listed as top level entry in manifest.json file
138+
139+
In Vite 4, the corresponding CSS file for a JavaScript entry point was also listed as a top-level entry in the manifest file ([`build.manifest`](/config/build-options.md#build-manifest)). These entries were unintentionally added and only worked for simple cases.
140+
141+
In Vite 5, corresponding CSS files can only be found within the JavaScript entry file section.
142+
When injecting the JS file, the corresponding CSS files [should be injected](/guide/backend-integration.md#:~:text=%3C!%2D%2D%20if%20production%20%2D%2D%3E%0A%3Clink%20rel%3D%22stylesheet%22%20href%3D%22/assets/%7B%7B%20manifest%5B%27main.js%27%5D.css%20%7D%7D%22%20/%3E%0A%3Cscript%20type%3D%22module%22%20src%3D%22/assets/%7B%7B%20manifest%5B%27main.js%27%5D.file%20%7D%7D%22%3E%3C/script%3E).
143+
When the CSS should be injected separately, it must be added as a separate entry point.
144+
137145
### CLI shortcuts require an additional `Enter` press
138146

139147
CLI shortcuts, like `r` to restart the dev server, now require an additional `Enter` press to trigger the shortcut. For example, `r + Enter` to restart the dev server.
@@ -230,6 +238,8 @@ Also there are other breaking changes which only affect few users.
230238
- `resolve.browserField` has been deprecated since Vite 3 in favour of an updated default of `['browser', 'module', 'jsnext:main', 'jsnext']` for [`resolve.mainFields`](/config/shared-options.md#resolve-mainfields).
231239
- [[#14855] feat!: add isPreview to ConfigEnv and resolveConfig](https://github.com/vitejs/vite/pull/14855)
232240
- Renamed `ssrBuild` to `isSsrBuild` in the `ConfigEnv` object.
241+
- [[#14945] fix(css): correctly set manifest source name and emit CSS file](https://github.com/vitejs/vite/pull/14945)
242+
- CSS file names are now generated based on the chunk name.
233243

234244
## Migration from v3
235245

0 commit comments

Comments
 (0)