mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 10:04:05 +00:00
fix(nuxi, vite): ipv6 support for nuxi dev
(#7560)
* fix(nuxi): ipv6 support for `nuxi dev` * fix vite: use listener url directly * add url to schema
This commit is contained in:
parent
1f3d9a1e84
commit
43b9bcaeaf
@ -36,7 +36,7 @@
|
|||||||
"flat": "^5.0.2",
|
"flat": "^5.0.2",
|
||||||
"giget": "^0.1.6",
|
"giget": "^0.1.6",
|
||||||
"jiti": "^1.15.0",
|
"jiti": "^1.15.0",
|
||||||
"listhen": "^0.3.0",
|
"listhen": "^0.3.1",
|
||||||
"mlly": "^0.5.14",
|
"mlly": "^0.5.14",
|
||||||
"mri": "^1.2.0",
|
"mri": "^1.2.0",
|
||||||
"pathe": "^0.3.7",
|
"pathe": "^0.3.7",
|
||||||
|
@ -91,6 +91,7 @@ export default defineNuxtCommand({
|
|||||||
|
|
||||||
await currentNuxt.hooks.callHook('listen', listener.server, listener)
|
await currentNuxt.hooks.callHook('listen', listener.server, listener)
|
||||||
const address = listener.server.address() as AddressInfo
|
const address = listener.server.address() as AddressInfo
|
||||||
|
currentNuxt.options.server.url = listener.url
|
||||||
currentNuxt.options.server.port = address.port
|
currentNuxt.options.server.port = address.port
|
||||||
currentNuxt.options.server.host = address.address
|
currentNuxt.options.server.host = address.address
|
||||||
currentNuxt.options.server.https = Boolean(args.https)
|
currentNuxt.options.server.https = Boolean(args.https)
|
||||||
|
@ -39,5 +39,10 @@ export default <SchemaDefinition>{
|
|||||||
* time spent on server-side rendering.
|
* time spent on server-side rendering.
|
||||||
*/
|
*/
|
||||||
/** @deprecated This option is ignored with Bridge and Nuxt 3 */
|
/** @deprecated This option is ignored with Bridge and Nuxt 3 */
|
||||||
timing: (val: any) => val ? ({ total: true, ...val }) : false
|
timing: (val: any) => val ? ({ total: true, ...val }) : false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Listening dev server url
|
||||||
|
*/
|
||||||
|
url: 'http://localhost:3000',
|
||||||
}
|
}
|
||||||
|
@ -123,13 +123,9 @@ function createViteNodeMiddleware (ctx: ViteBuildContext, invalidates: Set<strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function initViteNodeServer (ctx: ViteBuildContext) {
|
export async function initViteNodeServer (ctx: ViteBuildContext) {
|
||||||
const host = ctx.nuxt.options.server.host || 'localhost'
|
|
||||||
const port = ctx.nuxt.options.server.port || '3000'
|
|
||||||
const protocol = ctx.nuxt.options.server.https ? 'https' : 'http'
|
|
||||||
|
|
||||||
// Serialize and pass vite-node runtime options
|
// Serialize and pass vite-node runtime options
|
||||||
const viteNodeServerOptions = {
|
const viteNodeServerOptions = {
|
||||||
baseURL: `${protocol}://${host}:${port}/__nuxt_vite_node__`,
|
baseURL: `${ctx.nuxt.options.server.url}__nuxt_vite_node__`,
|
||||||
root: ctx.nuxt.options.srcDir,
|
root: ctx.nuxt.options.srcDir,
|
||||||
entryPath: ctx.entry,
|
entryPath: ctx.entry,
|
||||||
base: ctx.ssrServer!.config.base || '/_nuxt/'
|
base: ctx.ssrServer!.config.base || '/_nuxt/'
|
||||||
|
10
yarn.lock
10
yarn.lock
@ -9088,9 +9088,9 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"listhen@npm:^0.3.0":
|
"listhen@npm:^0.3.1":
|
||||||
version: 0.3.0
|
version: 0.3.1
|
||||||
resolution: "listhen@npm:0.3.0"
|
resolution: "listhen@npm:0.3.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
clipboardy: ^3.0.0
|
clipboardy: ^3.0.0
|
||||||
colorette: ^2.0.19
|
colorette: ^2.0.19
|
||||||
@ -9100,7 +9100,7 @@ __metadata:
|
|||||||
ip-regex: ^5.0.0
|
ip-regex: ^5.0.0
|
||||||
node-forge: ^1.3.1
|
node-forge: ^1.3.1
|
||||||
ufo: ^0.8.5
|
ufo: ^0.8.5
|
||||||
checksum: 4b34a6ef14e2bd91325275df567df6592233419f2bfc34195b565e29fa642ad74ffbeab3bcf524c314f4128ce0129d0d443b460c8bc0d1090f888c08cdf970ce
|
checksum: 2a260fd6edbf8459be04e6f762617b535a3bbbf92d79e219145c3a301b141b93987a2cfee42081a929e9d92b3628dc2cec93cb1fea4ec0539914c5dc3331fca2
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -10454,7 +10454,7 @@ __metadata:
|
|||||||
fsevents: ~2.3.2
|
fsevents: ~2.3.2
|
||||||
giget: ^0.1.6
|
giget: ^0.1.6
|
||||||
jiti: ^1.15.0
|
jiti: ^1.15.0
|
||||||
listhen: ^0.3.0
|
listhen: ^0.3.1
|
||||||
mlly: ^0.5.14
|
mlly: ^0.5.14
|
||||||
mri: ^1.2.0
|
mri: ^1.2.0
|
||||||
pathe: ^0.3.7
|
pathe: ^0.3.7
|
||||||
|
Loading…
Reference in New Issue
Block a user