fix(build): emit lean chunks after vite has done processing

closes #4737

Co-authored-by: green <green@sapphi.red>
pull/4739/head
Divyansh Singh 4 months ago
parent 827259b0d5
commit 26cb685adf

@ -353,14 +353,18 @@ export async function createVitePressPlugin(
return null return null
}, },
generateBundle(_options, bundle) { generateBundle: {
if (ssr) { order: ssr ? null : 'post',
this.emitFile({ handler(_options, bundle) {
type: 'asset', if (ssr) {
fileName: 'package.json', this.emitFile({
source: '{ "private": true, "type": "module" }' type: 'asset',
}) fileName: 'package.json',
} else { source: '{ "private": true, "type": "module" }'
})
return
}
// client build: // client build:
// for each .md entry chunk, adjust its name to its correct path. // for each .md entry chunk, adjust its name to its correct path.
for (const name in bundle) { for (const name in bundle) {

Loading…
Cancel
Save