Skip to content

Commit

Permalink
Fix copying swc binary for isolated tests locally
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Dec 2, 2021
1 parent 5747435 commit 86e2ee9
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/lib/create-next-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
)
},
})
}
}

Expand Down

0 comments on commit 86e2ee9

Please sign in to comment.