mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
perf(vite): simplify manifest property acccess (#24715)
This commit is contained in:
parent
628dc716b5
commit
4e0d2c073f
@ -36,12 +36,13 @@ export async function writeManifest (ctx: ViteBuildContext, css: string[] = [])
|
||||
const BASE_RE = new RegExp(`^${escapeRE(buildAssetsDir)}`)
|
||||
|
||||
for (const key in clientManifest) {
|
||||
if (clientManifest[key].file) {
|
||||
clientManifest[key].file = clientManifest[key].file.replace(BASE_RE, '')
|
||||
const entry = clientManifest[key]
|
||||
if (entry.file) {
|
||||
entry.file = entry.file.replace(BASE_RE, '')
|
||||
}
|
||||
for (const item of ['css', 'assets']) {
|
||||
if (clientManifest[key][item]) {
|
||||
clientManifest[key][item] = clientManifest[key][item].map((i: string) => i.replace(BASE_RE, ''))
|
||||
if (entry[item]) {
|
||||
entry[item] = entry[item].map((i: string) => i.replace(BASE_RE, ''))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user