diff --git a/packages/nitro/src/rollup/config.ts b/packages/nitro/src/rollup/config.ts index 60d956e18c..47cc06af40 100644 --- a/packages/nitro/src/rollup/config.ts +++ b/packages/nitro/src/rollup/config.ts @@ -89,6 +89,9 @@ export const getRollupConfig = (nitroContext: NitroContext) => { } else if (lastModule.includes('assets')) { prefix = 'assets' } + if (chunkInfo.name.includes('#')) { + return join('chunks', prefix, chunkInfo.name.replace(/#/g, '-') + '.mjs') + } return join('chunks', prefix, '[name].mjs') }, inlineDynamicImports: nitroContext.inlineDynamicImports,