File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
packages/@vue/cli-service/lib Expand file tree Collapse file tree 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 {
191191 config = merge ( config , fn )
192192 }
193193 } )
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+
194209 return config
195210 }
196211
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ module.exports = (api, options) => {
7171 }
7272
7373 // resolve raw webpack config
74+ process . env . VUE_CLI_BUILD_TARGET = args . target
7475 let webpackConfig
7576 if ( args . target === 'lib' ) {
7677 webpackConfig = require ( './resolveLibConfig' ) ( api , args , options )
You can’t perform that action at this time.
0 commit comments