Skip to content

Commit

Permalink
fix: allow building multiple times in the same dest dir (close #772)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Apr 24, 2022
1 parent 41351e9 commit 30bb4a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/@vuepress/bundler-vite/src/build/build.ts
Expand Up @@ -58,6 +58,9 @@ export const build = async (

// load the compiled server bundle
const serverEntryPath = app.dir.dest('.server', serverEntryChunk.fileName)
// delete server entry cache to allow building multiple times
// in the same dest dir
delete require.cache[serverEntryPath]
const { createVueApp } = require(serverEntryPath) as {
createVueApp: CreateVueAppFunction
}
Expand Down
3 changes: 3 additions & 0 deletions packages/@vuepress/bundler-webpack/src/build/build.ts
Expand Up @@ -76,6 +76,9 @@ export const build = async (

// load the compiled server bundle
const serverEntryPath = app.dir.dest('.server/app')
// delete server entry cache to allow building multiple times
// in the same dest dir
delete require.cache[serverEntryPath]
const { createVueApp } = require(serverEntryPath) as {
createVueApp: CreateVueAppFunction
}
Expand Down

0 comments on commit 30bb4a8

Please sign in to comment.