mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 01:17:16 +00:00
fix(vite): support multiple rollup entries (#19842)
This commit is contained in:
parent
8c11498a57
commit
4430c664e8
@ -57,7 +57,7 @@ export async function buildClient (ctx: ViteBuildContext) {
|
|||||||
manifest: true,
|
manifest: true,
|
||||||
outDir: resolve(ctx.nuxt.options.buildDir, 'dist/client'),
|
outDir: resolve(ctx.nuxt.options.buildDir, 'dist/client'),
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
input: ctx.entry
|
input: { entry: ctx.entry }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
@ -110,7 +110,7 @@ export async function buildClient (ctx: ViteBuildContext) {
|
|||||||
port: hmrPortDefault,
|
port: hmrPortDefault,
|
||||||
ports: Array.from({ length: 20 }, (_, i) => hmrPortDefault + 1 + i)
|
ports: Array.from({ length: 20 }, (_, i) => hmrPortDefault + 1 + i)
|
||||||
})
|
})
|
||||||
clientConfig.server = defu(clientConfig.server, <ServerOptions>{
|
clientConfig.server = defu(clientConfig.server, <ServerOptions> {
|
||||||
https: ctx.nuxt.options.devServer.https,
|
https: ctx.nuxt.options.devServer.https,
|
||||||
hmr: {
|
hmr: {
|
||||||
protocol: ctx.nuxt.options.devServer.https ? 'wss' : 'ws',
|
protocol: ctx.nuxt.options.devServer.https ? 'wss' : 'ws',
|
||||||
|
@ -87,10 +87,10 @@ export async function buildServer (ctx: ViteBuildContext) {
|
|||||||
outDir: resolve(ctx.nuxt.options.buildDir, 'dist/server'),
|
outDir: resolve(ctx.nuxt.options.buildDir, 'dist/server'),
|
||||||
ssr: true,
|
ssr: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
input: entry,
|
input: { server: entry },
|
||||||
external: ['#internal/nitro', ...ctx.nuxt.options.experimental.externalVue ? ['vue', 'vue-router'] : []],
|
external: ['#internal/nitro', ...ctx.nuxt.options.experimental.externalVue ? ['vue', 'vue-router'] : []],
|
||||||
output: {
|
output: {
|
||||||
entryFileNames: 'server.mjs',
|
entryFileNames: '[name].mjs',
|
||||||
format: 'module',
|
format: 'module',
|
||||||
generatedCode: {
|
generatedCode: {
|
||||||
constBindings: true
|
constBindings: true
|
||||||
|
Loading…
Reference in New Issue
Block a user