mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 01:17:16 +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) => {
|
const writeFile = async (file) => {
|
||||||
if (!await isFile(file)) { return }
|
if (!await isFile(file)) { return }
|
||||||
const src = resolve(opts.traceOptions.base, file)
|
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.mkdir(dirname(dst), { recursive: true })
|
||||||
await fsp.copyFile(src, dst)
|
await fsp.copyFile(src, dst)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user