fix(bridge): handle static nested vite dirs (#3565)

This commit is contained in:
Daniel Roe 2022-03-09 10:36:24 +00:00 committed by GitHub
parent 40d325e5c5
commit ef38147e52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,7 @@ export function setupNitroBridge () {
})
}
nuxt.hook('nitro:generate', async () => {
async function updateViteBase () {
const clientDist = resolve(nuxt.options.buildDir, 'dist/client')
// Remove public files that have been duplicated into buildAssetsDir
@ -97,7 +97,9 @@ export function setupNitroBridge () {
await fse.remove(nestedAssetsPath)
}
}
})
}
nuxt.hook('nitro:generate', updateViteBase)
nuxt.hook('generate:before', updateViteBase)
// Expose process.env.NITRO_PRESET
nuxt.options.env.NITRO_PRESET = nitroContext.preset