mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-21 08:45:53 +00:00
fix(vite): prevent overriding server build chunks
This commit is contained in:
parent
e531477f83
commit
b6b54d8c86
@ -90,6 +90,7 @@ export async function buildServer (ctx: ViteBuildContext) {
|
||||
new RegExp('^' + escapeStringRegexp(withTrailingSlash(resolve(ctx.nuxt.options.rootDir, ctx.nuxt.options.dir.shared)))),
|
||||
],
|
||||
output: {
|
||||
preserveModules: true,
|
||||
entryFileNames: '[name].mjs',
|
||||
format: 'module',
|
||||
generatedCode: {
|
||||
@ -115,6 +116,10 @@ export async function buildServer (ctx: ViteBuildContext) {
|
||||
},
|
||||
} satisfies vite.InlineConfig, ctx.nuxt.options.vite.$server || {}))
|
||||
|
||||
if (serverConfig.build?.rollupOptions?.output && !Array.isArray(serverConfig.build.rollupOptions.output)) {
|
||||
delete serverConfig.build.rollupOptions.output.manualChunks
|
||||
}
|
||||
|
||||
// tell rollup's nitro build about the original sources of the generated vite server build
|
||||
if (ctx.nuxt.options.sourcemap.server && !ctx.nuxt.options.dev) {
|
||||
const { vitePlugin, nitroPlugin } = createSourcemapPreserver()
|
||||
|
Loading…
Reference in New Issue
Block a user