diff --git a/packages/nitro/src/rollup/plugins/externals.ts b/packages/nitro/src/rollup/plugins/externals.ts index 20cd72adf3..e8403e3324 100644 --- a/packages/nitro/src/rollup/plugins/externals.ts +++ b/packages/nitro/src/rollup/plugins/externals.ts @@ -86,6 +86,10 @@ export function externals (opts: NodeExternalsOptions): Plugin { } const writeFile = async (file) => { + // Skip symlinks that are included in fileList + if (await fse.stat(file).then(i => i.isDirectory())) { + return + } const src = resolve(opts.traceOptions.base, file) const dst = resolve(opts.outDir, 'node_modules', file.split('node_modules/').pop()) await fse.mkdirp(dirname(dst))