fix(vite): support multiple rollup entries (#19842)

This commit is contained in:
Daniel Roe 2023-03-21 21:35:51 +00:00 committed by GitHub
parent 8c11498a57
commit 4430c664e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -57,7 +57,7 @@ export async function buildClient (ctx: ViteBuildContext) {
manifest: true,
outDir: resolve(ctx.nuxt.options.buildDir, 'dist/client'),
rollupOptions: {
input: ctx.entry
input: { entry: ctx.entry }
}
},
plugins: [
@ -110,7 +110,7 @@ export async function buildClient (ctx: ViteBuildContext) {
port: hmrPortDefault,
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,
hmr: {
protocol: ctx.nuxt.options.devServer.https ? 'wss' : 'ws',

View File

@ -87,10 +87,10 @@ export async function buildServer (ctx: ViteBuildContext) {
outDir: resolve(ctx.nuxt.options.buildDir, 'dist/server'),
ssr: true,
rollupOptions: {
input: entry,
input: { server: entry },
external: ['#internal/nitro', ...ctx.nuxt.options.experimental.externalVue ? ['vue', 'vue-router'] : []],
output: {
entryFileNames: 'server.mjs',
entryFileNames: '[name].mjs',
format: 'module',
generatedCode: {
constBindings: true