File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/@vuepress/core/lib/node Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
const { fs, path, chalk, logger } = require ( '@vuepress/shared-utils' )
2
2
3
+ // Only empty the `.temp` directory at most once per run to avoid
4
+ // compilation errors caused by removed files.
5
+ // See: https://github.com/vuejs/vuepress/issues/2254#issuecomment-689457157
6
+ let alreadyEmptied = false
7
+
3
8
/**
4
9
* Create a dynamic temp utility context that allow to lanuch
5
10
* multiple apps with isolated context at the same time.
@@ -19,8 +24,9 @@ module.exports = function createTemp (tempPath) {
19
24
20
25
if ( ! fs . existsSync ( tempPath ) ) {
21
26
fs . ensureDirSync ( tempPath )
22
- } else {
27
+ } else if ( ! alreadyEmptied ) {
23
28
fs . emptyDirSync ( tempPath )
29
+ alreadyEmptied = true
24
30
}
25
31
26
32
logger . debug ( `Temp directory: ${ chalk . gray ( tempPath ) } ` )
You can’t perform that action at this time.
0 commit comments