From ae2548f67a84de4a2d3f53ab833241f715450753 Mon Sep 17 00:00:00 2001 From: Maciek Kucmus Date: Tue, 6 Jul 2021 16:31:34 +0200 Subject: [PATCH] fix: use env from parent process (#1583) Co-authored-by: patzick <13100280+patzick@users.noreply.github.com> --- scripts/build.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/build.js b/scripts/build.js index f2e2bec53..d12f29c22 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -90,6 +90,7 @@ async function runBuild({ additionalEntrypoints = [], }) { const buildTarget = format === "esm" ? "es2020" : "es2015"; + const platform = format === "cjs" ? "node" : "neutral"; try { const dependencies = Object.keys(packageJson.dependencies || {}); @@ -103,6 +104,7 @@ async function runBuild({ external, target: buildTarget, format, + platform, }); if (additionalEntrypoints.length) { const promisses = additionalEntrypoints.map((entrypoint) => { @@ -121,6 +123,7 @@ async function runBuild({ external, target: buildTarget, format, + platform, }); }); await Promise.all(promisses); @@ -162,7 +165,10 @@ async function build(target) { // run custom package build if there is one if (pkg.scripts && pkg.scripts.build) { - await execa("yarn", ["build"], { stdio: "inherit", cwd: pkgDir }); + await execa("yarn", ["build"], { + stdio: "inherit", + cwd: pkgDir, + }); return; }