diff --git a/packages/nitro/src/rollup/plugins/dynamic-require.ts b/packages/nitro/src/rollup/plugins/dynamic-require.ts index 98eead7675..1e3d9a23f9 100644 --- a/packages/nitro/src/rollup/plugins/dynamic-require.ts +++ b/packages/nitro/src/rollup/plugins/dynamic-require.ts @@ -57,7 +57,7 @@ export function dynamicRequire ({ dir, globbyOptions, inline }: Options): Plugin const chunks = files.map(id => ({ id, src: resolve(dir, id).replace(/\\/g, '/'), - name: '_' + id.replace(/[\\/.]/g, '_'), + name: '_' + id.replace(/[^a-zA-Z_]/g, '_'), meta: getWebpackChunkMeta(resolve(dir, id)) }))