Skip to content

Commit

Permalink
fix(bridge): handle static nested vite dirs (nuxt#3565)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Mar 9, 2022
1 parent 40d325e commit ef38147
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/bridge/src/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ef38147

Please sign in to comment.