mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-21 20:08:41 -05:00
fix(cli-service): do not display absolute baseUrl (#2900)
This commit is contained in:
@@ -42,6 +42,7 @@ module.exports = (api, options) => {
|
||||
const prepareProxy = require('../util/prepareProxy')
|
||||
const launchEditorMiddleware = require('launch-editor-middleware')
|
||||
const validateWebpackConfig = require('../util/validateWebpackConfig')
|
||||
const isAbsoluteUrl = require('../util/isAbsoluteUrl')
|
||||
|
||||
// resolve webpack config
|
||||
const webpackConfig = api.resolveWebpackConfig()
|
||||
@@ -89,7 +90,7 @@ module.exports = (api, options) => {
|
||||
protocol,
|
||||
host,
|
||||
port,
|
||||
options.baseUrl
|
||||
isAbsoluteUrl(options.baseUrl) ? '/' : options.baseUrl
|
||||
)
|
||||
|
||||
const proxySettings = prepareProxy(
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
module.exports = function isAbsoluteUrl (url) {
|
||||
// A URL is considered absolute if it begins with "<scheme>://" or "//"
|
||||
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url)
|
||||
}
|
||||
Reference in New Issue
Block a user