File tree 1 file changed +8
-2
lines changed
packages/@vuepress/bundler-webpack/src/dev
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ export const createDev = (options: WebpackBundlerOptions): BundlerDev => async (
19
19
// resolve host and port
20
20
const host = app . options . host
21
21
const port = await resolvePort ( app . options . port )
22
- const url = `http://${ host } :${ port } ${ app . options . base } `
23
22
24
23
// create webpack config
25
24
const config = createDevConfig ( app , options )
@@ -75,7 +74,14 @@ export const createDev = (options: WebpackBundlerOptions): BundlerDev => async (
75
74
return reject ( err )
76
75
}
77
76
78
- logger . success ( `VuePress dev server is listening at ${ chalk . cyan ( url ) } ` )
77
+ // print url in console
78
+ // replace `0.0.0.0` with `localhost` as `0.0.0.0` is not available on windows
79
+ const url = `http://${ host === '0.0.0.0' ? 'localhost' : host } :${ port } ${
80
+ app . options . base
81
+ } `
82
+ logger . success (
83
+ `VuePress webpack dev server is listening at ${ chalk . cyan ( url ) } `
84
+ )
79
85
80
86
// promisify the close function
81
87
const close = ( ) : Promise < void > =>
You can’t perform that action at this time.
0 commit comments