File tree Expand file tree Collapse file tree 5 files changed +1
-50
lines changed
Expand file tree Collapse file tree 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')
66const path = require ( 'path' )
77const Service = require ( '../lib/Service' )
88
9- const { logs } = require ( '@vue/cli-shared-utils' )
10-
119const mockPkg = json => {
1210 fs . writeFileSync ( '/package.json' , JSON . stringify ( json , null , 2 ) )
1311}
@@ -84,29 +82,6 @@ test('load project options from package.json', () => {
8482 expect ( service . projectOptions . lintOnSave ) . toBe ( 'default' )
8583} )
8684
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-
11085test ( 'handle option publicPath and outputDir correctly' , ( ) => {
11186 mockPkg ( {
11287 vue : {
Original file line number Diff line number Diff line change @@ -346,28 +346,11 @@ module.exports = class Service {
346346 resolvedFrom = 'inline options'
347347 }
348348
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-
364349 // normalize some options
365350 ensureSlash ( resolved , 'publicPath' )
366351 if ( typeof resolved . publicPath === 'string' ) {
367352 resolved . publicPath = resolved . publicPath . replace ( / ^ \. \/ / , '' )
368353 }
369- // for compatibility concern, in case some plugins still rely on `baseUrl` option
370- resolved . baseUrl = resolved . publicPath
371354 removeSlash ( resolved , 'outputDir' )
372355
373356 // validate options
Original file line number Diff line number Diff line change 11const { createSchema, validate } = require ( '@vue/cli-shared-utils' )
22
33const schema = createSchema ( joi => joi . object ( {
4- baseUrl : joi . string ( ) . allow ( '' ) ,
54 publicPath : joi . string ( ) . allow ( '' ) ,
65 outputDir : joi . string ( ) ,
76 assetsDir : joi . string ( ) . allow ( '' ) ,
@@ -79,8 +78,6 @@ function hasMultipleCores () {
7978exports . defaults = ( ) => ( {
8079 // project deployment base
8180 publicPath : '/' ,
82- // for compatibility concern. TODO: remove in v4.
83- baseUrl : '/' ,
8481
8582 // where to output built files
8683 outputDir : 'dist' ,
Original file line number Diff line number Diff line change 601601 "general" : " General settings" ,
602602 "css" : " CSS settings"
603603 },
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- },
608604 "publicPath" : {
609605 "label" : " Public Path" ,
610606 "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 => {
1616 name : 'publicPath' ,
1717 type : 'input' ,
1818 default : '/' ,
19- value : data . vue && ( data . vue . publicPath || data . vue . baseUrl ) , // fallback to baseUrl for compatibility
19+ value : data . vue && data . vue . publicPath ,
2020 message : 'org.vue.vue-webpack.config.vue-cli.publicPath.label' ,
2121 description : 'org.vue.vue-webpack.config.vue-cli.publicPath.description' ,
2222 group : 'org.vue.vue-webpack.config.vue-cli.groups.general' ,
You can’t perform that action at this time.
0 commit comments