Skip to content

Commit 4e876b8

Browse files
committed
updated serve.js
1 parent 970ade9 commit 4e876b8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/@vue/cli-service/lib/commands/serve.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ module.exports = (api, options) => {
116116
protocol,
117117
host,
118118
port,
119-
isAbsoluteUrl(options.publicPath) ? '/' : options.publicPath
119+
isAbsoluteUrl(options.publicPath) || options.publicPath === 'auto'
120+
? '/'
121+
: options.publicPath
120122
)
121123
const localUrlForBrowser = publicUrl || urls.localUrlForBrowser
122124

packages/@vue/cli-service/lib/util/prepareURLs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ module.exports = function prepareUrls (protocol, host, port, pathname = '/') {
1717
protocol,
1818
hostname,
1919
port,
20-
pathname: pathname === 'auto' ? '' : pathname
20+
pathname
2121
})
2222
const prettyPrintUrl = hostname =>
2323
url.format({
2424
protocol,
2525
hostname,
2626
port: chalk.bold(port),
27-
pathname: pathname === 'auto' ? '' : pathname
27+
pathname
2828
})
2929

3030
const isUnspecifiedHost = host === '0.0.0.0' || host === '::'

0 commit comments

Comments
 (0)