|
|
@ -366,15 +366,12 @@ export async function createVitePressPlugin(
|
|
|
|
pageToHashMap![chunk.name.toLowerCase()] = hash
|
|
|
|
pageToHashMap![chunk.name.toLowerCase()] = hash
|
|
|
|
|
|
|
|
|
|
|
|
// inject another chunk with the content stripped
|
|
|
|
// inject another chunk with the content stripped
|
|
|
|
bundle[name + '-lean'] = {
|
|
|
|
this.emitFile({
|
|
|
|
...chunk,
|
|
|
|
type: 'asset',
|
|
|
|
|
|
|
|
name: name + '-lean',
|
|
|
|
fileName: chunk.fileName.replace(/\.js$/, '.lean.js'),
|
|
|
|
fileName: chunk.fileName.replace(/\.js$/, '.lean.js'),
|
|
|
|
preliminaryFileName: chunk.preliminaryFileName.replace(
|
|
|
|
source: chunk.code.replace(staticStripRE, `""`)
|
|
|
|
/\.js$/,
|
|
|
|
})
|
|
|
|
'.lean.js'
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
code: chunk.code.replace(staticStripRE, `""`)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// remove static markers from original code
|
|
|
|
// remove static markers from original code
|
|
|
|
chunk.code = chunk.code.replace(staticRestoreRE, '')
|
|
|
|
chunk.code = chunk.code.replace(staticRestoreRE, '')
|
|
|
|