From 2680894cddb27004c6319c1c4460fd4daf14735b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Thu, 12 Oct 2023 14:11:31 +0900 Subject: [PATCH] Use separate package.json for @swc/core --- utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils.ts b/utils.ts index b51885e..e1616c9 100644 --- a/utils.ts +++ b/utils.ts @@ -257,7 +257,7 @@ export async function runInRepo(options: RunOptions & RepoOptions) { await testCommand?.(pkg.scripts); } const overrides = options.overrides || {}; - overrides["@swc/core"] = path.join(root, "node_modules", "@swc", "core"); + overrides["@swc/core"] = path.join(swcPath, "node_modules", "@swc", "core"); console.log("OVERRIDES", overrides); await applyPackageOverrides(dir, pkg, overrides); await beforeBuildCommand?.(pkg.scripts); @@ -460,6 +460,8 @@ export function dirnameFrom(url: string) { } export async function installSwc({ version }: { version: string }) { - cd(root); + await fs.promises.mkdir(swcPath, { recursive: true }); + await fs.promises.writeFile(path.join(swcPath, "package.json"), "{}", "utf8"); + cd(swcPath); await $`npm install @swc/core@${version} --no-save --legacy-peer-deps`; }