File tree 2 files changed +16
-0
lines changed
packages/@vue/cli-service/lib 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,21 @@ module.exports = class Service {
191
191
config = merge ( config , fn )
192
192
}
193
193
} )
194
+
195
+ // check if the user has manually mutated output.publicPath
196
+ const target = process . env . VUE_CLI_BUILD_TARGET
197
+ const exceptionTargets = [ 'lib' , 'wc' , 'wc-async' ]
198
+ if (
199
+ ! exceptionTargets . includes ( target ) &&
200
+ config . output . publicPath !== this . projectOptions . baseUrl
201
+ ) {
202
+ error (
203
+ `Do not modify webpack output.publicPath directly. ` +
204
+ `Use the "baseUrl" option in vue.config.js instead.`
205
+ )
206
+ process . exit ( 1 )
207
+ }
208
+
194
209
return config
195
210
}
196
211
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ module.exports = (api, options) => {
71
71
}
72
72
73
73
// resolve raw webpack config
74
+ process . env . VUE_CLI_BUILD_TARGET = args . target
74
75
let webpackConfig
75
76
if ( args . target === 'lib' ) {
76
77
webpackConfig = require ( './resolveLibConfig' ) ( api , args , options )
You can’t perform that action at this time.
0 commit comments