mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 09:25:54 +00:00
fix(nitro): fix EBUSY error on windows (#425)
This commit is contained in:
parent
4b5d9f1052
commit
3516f40e06
@ -81,12 +81,20 @@ export function externals (opts: NodeExternalsOptions): Plugin {
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.all(tracedFiles.map(async (file) => {
|
||||
const writeFile = async (file) => {
|
||||
const src = resolve(opts.traceOptions.base, file)
|
||||
const dst = resolve(opts.outDir, 'node_modules', file.split('node_modules/').pop())
|
||||
await mkdirp(dirname(dst))
|
||||
await copyFile(src, dst)
|
||||
}))
|
||||
}
|
||||
if (process.platform === 'win32') {
|
||||
// Workaround for EBUSY on windows (#424)
|
||||
for (const file of tracedFiles) {
|
||||
await writeFile(file)
|
||||
}
|
||||
} else {
|
||||
await Promise.all(tracedFiles.map(writeFile))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user