File tree 2 files changed +6
-1
lines changed
packages/@vue/cli-service/lib
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ module.exports = (api, options) => {
42
42
const prepareProxy = require ( '../util/prepareProxy' )
43
43
const launchEditorMiddleware = require ( 'launch-editor-middleware' )
44
44
const validateWebpackConfig = require ( '../util/validateWebpackConfig' )
45
+ const isAbsoluteUrl = require ( '../util/isAbsoluteUrl' )
45
46
46
47
// resolve webpack config
47
48
const webpackConfig = api . resolveWebpackConfig ( )
@@ -89,7 +90,7 @@ module.exports = (api, options) => {
89
90
protocol ,
90
91
host ,
91
92
port ,
92
- options . baseUrl
93
+ isAbsoluteUrl ( options . baseUrl ) ? '/' : options . baseUrl
93
94
)
94
95
95
96
const proxySettings = prepareProxy (
Original file line number Diff line number Diff line change
1
+ module . exports = function isAbsoluteUrl ( url ) {
2
+ // A URL is considered absolute if it begins with "<scheme>://" or "//"
3
+ return / ^ ( [ a - z ] [ a - z \d \+ \- \. ] * : ) ? \/ \/ / i. test ( url )
4
+ }
You can’t perform that action at this time.
0 commit comments