Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
move dev guard
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed May 2, 2022
1 parent 76f8235 commit 23898bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nuxt/src/core/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ export async function initNitro (nuxt: Nuxt) {

// nuxt build/dev
nuxt.hook('build:done', async () => {
await nuxt.callHook('nitro:build:before', nitro)
if (nuxt.options.dev) {
await build(nitro)
} else {
await nuxt.callHook('nitro:build:before', nitro)
await prepare(nitro)
await copyPublicAssets(nitro)
await prerender(nitro)
Expand Down
3 changes: 3 additions & 0 deletions packages/vite/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ export async function buildServer (ctx: ViteBuildContext) {
await ctx.nuxt.callHook('vite:extendConfig', serverConfig, { isClient: false, isServer: true })

ctx.nuxt.hook('nitro:build:before', async () => {
if (ctx.nuxt.options.dev) {
return
}
const clientDist = resolve(ctx.nuxt.options.buildDir, 'dist/client')

// Remove public files that have been duplicated into buildAssetsDir
Expand Down

0 comments on commit 23898bf

Please sign in to comment.