Skip to content
Prev Previous commit
Next Next commit
docs: fix formatting issues
  • Loading branch information
abbasyed committed Sep 13, 2025
commit b00a9a7d8c2813925ec33302f7990271dc96b916
6 changes: 2 additions & 4 deletions docs/guide/api-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo
Dedicated hook for transforming HTML entry point files such as `index.html`. The hook receives the current HTML string and a transform context. The context exposes the [`ViteDevServer`](./api-javascript#vitedevserver) instance during dev, and exposes the Rollup output bundle during build.

The hook can be async and can return one of the following:

- Transformed HTML string
- An array of tag descriptor objects (`{ tag, attrs, children }`) to inject to the existing HTML. Each tag can also specify where it should be injected to (default is prepending to `<head>`)
- An object containing both as `{ html, tags }`
Expand All @@ -354,7 +353,7 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo
transformIndexHtml(html) {
return html.replace(
/<title>(.*?)<\/title>/,
`<title>Title replaced!</title>`
`<title>Title replaced!</title>`,
)
},
}
Expand All @@ -372,7 +371,7 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo
server?: ViteDevServer
bundle?: import('rollup').OutputBundle
chunk?: import('rollup').OutputChunk
}
},
) =>
| IndexHtmlTransformResult
| void
Expand Down Expand Up @@ -424,7 +423,6 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo
- `read` is an async read function that returns the content of the file. This is provided because on some systems, the file change callback may fire too fast before the editor finishes updating the file and direct `fs.readFile` will return empty content. The read function passed in normalizes this behavior.

The hook can choose to:

- Filter and narrow down the affected module list so that the HMR is more accurate.

- Return an empty array and perform a full reload:
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/rolldown.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export default defineConfig({
svgr({
/*...*/
}),
{ load: { id: /\.svg\?react$/ } }
{ load: { id: /\.svg\?react$/ } },
),
],
})
Expand Down