File tree 5 files changed +1
-50
lines changed 5 files changed +1
-50
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ const fs = require('fs')
6
6
const path = require ( 'path' )
7
7
const Service = require ( '../lib/Service' )
8
8
9
- const { logs } = require ( '@vue/cli-shared-utils' )
10
-
11
9
const mockPkg = json => {
12
10
fs . writeFileSync ( '/package.json' , JSON . stringify ( json , null , 2 ) )
13
11
}
@@ -84,29 +82,6 @@ test('load project options from package.json', () => {
84
82
expect ( service . projectOptions . lintOnSave ) . toBe ( 'default' )
85
83
} )
86
84
87
- test ( 'deprecate baseUrl' , ( ) => {
88
- mockPkg ( {
89
- vue : {
90
- baseUrl : './foo/bar'
91
- }
92
- } )
93
- createMockService ( )
94
- expect ( logs . warn . some ( ( [ msg ] ) => msg . match ( 'is deprecated now, please use "publicPath" instead.' ) ) )
95
- } )
96
-
97
- test ( 'discard baseUrl if publicPath also exists' , ( ) => {
98
- mockPkg ( {
99
- vue : {
100
- baseUrl : '/foo/barbase/' ,
101
- publicPath : '/foo/barpublic/'
102
- }
103
- } )
104
-
105
- const service = createMockService ( )
106
- expect ( logs . warn . some ( ( [ msg ] ) => msg . match ( '"baseUrl" will be ignored in favor of "publicPath"' ) ) )
107
- expect ( service . projectOptions . publicPath ) . toBe ( '/foo/barpublic/' )
108
- } )
109
-
110
85
test ( 'handle option publicPath and outputDir correctly' , ( ) => {
111
86
mockPkg ( {
112
87
vue : {
Original file line number Diff line number Diff line change @@ -346,28 +346,11 @@ module.exports = class Service {
346
346
resolvedFrom = 'inline options'
347
347
}
348
348
349
- if ( typeof resolved . baseUrl !== 'undefined' ) {
350
- if ( typeof resolved . publicPath !== 'undefined' ) {
351
- warn (
352
- `You have set both "baseUrl" and "publicPath" in ${ chalk . bold ( 'vue.config.js' ) } , ` +
353
- `in this case, "baseUrl" will be ignored in favor of "publicPath".`
354
- )
355
- } else {
356
- warn (
357
- `"baseUrl" option in ${ chalk . bold ( 'vue.config.js' ) } ` +
358
- `is deprecated now, please use "publicPath" instead.`
359
- )
360
- resolved . publicPath = resolved . baseUrl
361
- }
362
- }
363
-
364
349
// normalize some options
365
350
ensureSlash ( resolved , 'publicPath' )
366
351
if ( typeof resolved . publicPath === 'string' ) {
367
352
resolved . publicPath = resolved . publicPath . replace ( / ^ \. \/ / , '' )
368
353
}
369
- // for compatibility concern, in case some plugins still rely on `baseUrl` option
370
- resolved . baseUrl = resolved . publicPath
371
354
removeSlash ( resolved , 'outputDir' )
372
355
373
356
// validate options
Original file line number Diff line number Diff line change 1
1
const { createSchema, validate } = require ( '@vue/cli-shared-utils' )
2
2
3
3
const schema = createSchema ( joi => joi . object ( {
4
- baseUrl : joi . string ( ) . allow ( '' ) ,
5
4
publicPath : joi . string ( ) . allow ( '' ) ,
6
5
outputDir : joi . string ( ) ,
7
6
assetsDir : joi . string ( ) . allow ( '' ) ,
@@ -79,8 +78,6 @@ function hasMultipleCores () {
79
78
exports . defaults = ( ) => ( {
80
79
// project deployment base
81
80
publicPath : '/' ,
82
- // for compatibility concern. TODO: remove in v4.
83
- baseUrl : '/' ,
84
81
85
82
// where to output built files
86
83
outputDir : 'dist' ,
Original file line number Diff line number Diff line change 601
601
"general" : " General settings" ,
602
602
"css" : " CSS settings"
603
603
},
604
- "baseUrl" : {
605
- "label" : " Base URL" ,
606
- "description" : " The base URL your application will be deployed at, for example '/my-app/'. Use an empty string ('') so that all assets are linked using relative paths."
607
- },
608
604
"publicPath" : {
609
605
"label" : " Public Path" ,
610
606
"description" : " The base URL your application will be deployed at, for example '/my-app/'. Use an empty string ('') so that all assets are linked using relative paths."
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ module.exports = api => {
16
16
name : 'publicPath' ,
17
17
type : 'input' ,
18
18
default : '/' ,
19
- value : data . vue && ( data . vue . publicPath || data . vue . baseUrl ) , // fallback to baseUrl for compatibility
19
+ value : data . vue && data . vue . publicPath ,
20
20
message : 'org.vue.vue-webpack.config.vue-cli.publicPath.label' ,
21
21
description : 'org.vue.vue-webpack.config.vue-cli.publicPath.description' ,
22
22
group : 'org.vue.vue-webpack.config.vue-cli.groups.general' ,
You can’t perform that action at this time.
0 commit comments