Skip to content

Commit

Permalink
fix!: put manifest files in .vite directory by default (#14230)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Sep 18, 2023
1 parent a7ed3c5 commit 8052801
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/build-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Build as a library. `entry` is required since the library cannot use HTML as ent
- **Default:** `false`
- **Related:** [Backend Integration](/guide/backend-integration)
When set to `true`, the build will also generate a `manifest.json` file that contains a mapping of non-hashed asset filenames to their hashed versions, which can then be used by a server framework to render the correct asset links. When the value is a string, it will be used as the manifest file name.
When set to `true`, the build will also generate a `.vite/manifest.json` file that contains a mapping of non-hashed asset filenames to their hashed versions, which can then be used by a server framework to render the correct asset links. When the value is a string, it will be used as the manifest file name.
## build.ssrManifest
Expand Down
4 changes: 2 additions & 2 deletions guide/backend-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you need a custom integration, you can follow the steps in this guide to conf
// vite.config.js
export default defineConfig({
build: {
// generate manifest.json in outDir
// generate .vite/manifest.json in outDir
manifest: true,
rollupOptions: {
// overwrite default .html entry
Expand Down Expand Up @@ -56,7 +56,7 @@ If you need a custom integration, you can follow the steps in this guide to conf
</script>
```

3. For production: after running `vite build`, a `manifest.json` file will be generated alongside other asset files. An example manifest file looks like this:
3. For production: after running `vite build`, a `.vite/manifest.json` file will be generated alongside other asset files. An example manifest file looks like this:

```json
{
Expand Down
4 changes: 2 additions & 2 deletions guide/ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,14 @@ Refer to the [Vue](https://github.com/vitejs/vite-plugin-vue/tree/main/playgroun
## Generating Preload Directives
`vite build` supports the `--ssrManifest` flag which will generate `ssr-manifest.json` in build output directory:
`vite build` supports the `--ssrManifest` flag which will generate `.vite/ssr-manifest.json` in build output directory:
```diff
- "build:client": "vite build --outDir dist/client",
+ "build:client": "vite build --outDir dist/client --ssrManifest",
```
The above script will now generate `dist/client/ssr-manifest.json` for the client build (Yes, the SSR manifest is generated from the client build because we want to map module IDs to client files). The manifest contains mappings of module IDs to their associated chunks and asset files.
The above script will now generate `dist/client/.vite/ssr-manifest.json` for the client build (Yes, the SSR manifest is generated from the client build because we want to map module IDs to client files). The manifest contains mappings of module IDs to their associated chunks and asset files.
To leverage the manifest, frameworks need to provide a way to collect the module IDs of the components that were used during a server render call.
Expand Down

0 comments on commit 8052801

Please sign in to comment.