mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +00:00
fix(nitro): respect fs structure for traced files (#2107)
This commit is contained in:
parent
15dad0e039
commit
fe5b5dcea6
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user