fix: copy publicPath option to baseUrl, fix plugin compatibility

This commit is contained in:
Haoqun Jiang
2019-01-13 01:23:04 +08:00
parent 469ced1927
commit 27ffd28e7d
2 changed files with 4 additions and 4 deletions

View File

@@ -339,15 +339,13 @@ module.exports = class Service {
}
}
// if (typeof resolved.publicPath === 'undefined') {
// resolved.publicPath = '/'
// }
// normalize some options
ensureSlash(resolved, 'publicPath')
if (typeof resolved.publicPath === 'string') {
resolved.publicPath = resolved.publicPath.replace(/^\.\//, '')
}
// for compatibility concern, in case some plugins still rely on `baseUrl` option
resolved.baseUrl = resolved.publicPath
removeSlash(resolved, 'outputDir')
// deprecation warning

View File

@@ -71,6 +71,8 @@ function hasMultipleCores () {
exports.defaults = () => ({
// project deployment base
publicPath: '/',
// for compatibility concern. TODO: remove in v4.
baseUrl: '/',
// where to output built files
outputDir: 'dist',