Skip to content

Commit f62cd73

Browse files
committed
fix($core): try to fix windows output path issue
1 parent 113a1dd commit f62cd73

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/@vuepress/core/lib/build.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ module.exports = async function build (sourceDir, cliOptions = {}) {
2222
}
2323

2424
const { outDir } = options
25-
if (path.resolve() === outDir) {
25+
if (process.cwd() === outDir) {
2626
return console.error(logger.error(chalk.red('Unexpected option: outDir cannot be set to the current working directory.\n'), false))
2727
}
2828
await fs.remove(outDir)
29-
logger.debug('Dist directory: ' + chalk.gray(path.resolve(outDir)))
29+
logger.debug('Dist directory: ' + chalk.gray(path.resolve(process.cwd(), outDir)))
3030

3131
let clientConfig = createClientConfig(options, cliOptions).toConfig()
3232
let serverConfig = createServerConfig(options, cliOptions).toConfig()

packages/@vuepress/core/lib/prepare/AppContext.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports = class AppContext {
5252
this.base = this.siteConfig.base || '/'
5353
this.themeConfig = this.siteConfig.themeConfig || {}
5454
this.outDir = this.siteConfig.dest
55-
? path.resolve(this.siteConfig.dest)
55+
? path.resolve(process.cwd(), this.siteConfig.dest)
5656
: path.resolve(sourceDir, '.vuepress/dist')
5757

5858
this.pluginAPI = new PluginAPI(this)

0 commit comments

Comments
 (0)