Skip to content

Commit 0bb85a4

Browse files
Sun Haoranmeteorlxy
Sun Haoran
authored andcommittedNov 27, 2019
fix($core): temp option in siteConfig has not effect (fix #2038) (#2040)
1 parent fc48e21 commit 0bb85a4

File tree

1 file changed

+8
-4
lines changed
  • packages/@vuepress/core/lib/node

1 file changed

+8
-4
lines changed
 

‎packages/@vuepress/core/lib/node/App.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ module.exports = class App {
4646
logger.warn(`Source directory doesn't exist: ${chalk.yellow(this.sourceDir)}`)
4747
}
4848

49-
const { tempPath, writeTemp } = createTemp(options.temp)
50-
this.tempPath = tempPath
51-
this.writeTemp = writeTemp
52-
5349
this.vuepressDir = path.resolve(this.sourceDir, '.vuepress')
5450
this.libDir = path.join(__dirname, '../')
5551
}
@@ -78,10 +74,18 @@ module.exports = class App {
7874
this.base = this.siteConfig.base || '/'
7975
this.themeConfig = this.siteConfig.themeConfig || {}
8076

77+
// resolve tempPath
78+
const rawTemp = this.options.temp || this.siteConfig.temp
79+
const { tempPath, writeTemp } = createTemp(rawTemp)
80+
this.tempPath = tempPath
81+
this.writeTemp = writeTemp
82+
83+
// resolve outDir
8184
const rawOutDir = this.options.dest || this.siteConfig.dest
8285
this.outDir = rawOutDir
8386
? require('path').resolve(this.cwd, rawOutDir)
8487
: require('path').resolve(this.sourceDir, '.vuepress/dist')
88+
8589
this.pages = [] // Array<Page>
8690
this.pluginAPI = new PluginAPI(this)
8791
this.ClientComputedMixinConstructor = ClientComputedMixin(this.getSiteData())

0 commit comments

Comments
 (0)
Please sign in to comment.