Fix copying swc binary for isolated tests locally (#32026)
This commit is contained in:
parent
494e37c026
commit
03317c7507
1 changed files with 9 additions and 8 deletions
|
@ -18,15 +18,16 @@ async function createNextInstall(dependencies) {
|
|||
)) {
|
||||
if (folder.startsWith('swc-')) {
|
||||
const swcPkgPath = path.join(origRepoDir, 'node_modules/@next', folder)
|
||||
await fs.copy(
|
||||
swcPkgPath,
|
||||
path.join(origRepoDir, 'packages/next-swc/native'),
|
||||
{
|
||||
filter: (item) =>
|
||||
const outputPath = path.join(origRepoDir, 'packages/next-swc/native')
|
||||
await fs.copy(swcPkgPath, outputPath, {
|
||||
filter: (item) => {
|
||||
return (
|
||||
item === swcPkgPath ||
|
||||
(item.endsWith('.node') && !fs.pathExistsSync(item)),
|
||||
}
|
||||
)
|
||||
(item.endsWith('.node') &&
|
||||
!fs.pathExistsSync(path.join(outputPath, path.basename(item))))
|
||||
)
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue