Skip to content

Commit

Permalink
fix(nitro): respect fs structure for traced files (#2107)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Nov 23, 2021
1 parent 9e004e1 commit e3faaed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rollup/plugins/externals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function externals (opts: NodeExternalsOptions): Plugin {
const writeFile = async (file) => {
if (!await isFile(file)) { return }
const src = resolve(opts.traceOptions.base, file)
const dst = resolve(opts.outDir, 'node_modules', file.split('node_modules/').pop())
const dst = resolve(opts.outDir, 'node_modules', file.replace(/^.*?node_modules[\\/](.*)$/, '$1'))
await fsp.mkdir(dirname(dst), { recursive: true })
await fsp.copyFile(src, dst)
}
Expand Down

0 comments on commit e3faaed

Please sign in to comment.