Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix($core): temp option in siteConfig has not effect (fix #2038) #2040

Merged
merged 3 commits into from
Nov 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions packages/@vuepress/core/lib/node/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ module.exports = class App {
logger.warn(`Source directory doesn't exist: ${chalk.yellow(this.sourceDir)}`)
}

const { tempPath, writeTemp } = createTemp(options.temp)
this.tempPath = tempPath
this.writeTemp = writeTemp

this.vuepressDir = path.resolve(this.sourceDir, '.vuepress')
this.libDir = path.join(__dirname, '../')
}
Expand Down Expand Up @@ -78,10 +74,18 @@ module.exports = class App {
this.base = this.siteConfig.base || '/'
this.themeConfig = this.siteConfig.themeConfig || {}

// resolve tempPath
const rawTemp = this.options.temp || this.siteConfig.temp
const { tempPath, writeTemp } = createTemp(rawTemp)
this.tempPath = tempPath
this.writeTemp = writeTemp

// resolve outDir
const rawOutDir = this.options.dest || this.siteConfig.dest
this.outDir = rawOutDir
? require('path').resolve(this.cwd, rawOutDir)
: require('path').resolve(this.sourceDir, '.vuepress/dist')

this.pages = [] // Array<Page>
this.pluginAPI = new PluginAPI(this)
this.ClientComputedMixinConstructor = ClientComputedMixin(this.getSiteData())
Expand Down