Skip to content

Commit 8fffd51

Browse files
author
Brijesh Bittu
committed
Use babel/runtime version specified in pnpm-workspace.yaml
1 parent b265f19 commit 8fffd51

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/build.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ async function run(argv) {
5151
);
5252
} else if (babelRuntimeVersion === 'catalog:') {
5353
// resolve the version from the given package
54-
const { stdout: listedBabelRuntime } = await exec('pnpm list "@babel/runtime" --json');
55-
const jsonListedDependencies = JSON.parse(listedBabelRuntime);
56-
babelRuntimeVersion = jsonListedDependencies[0].dependencies['@babel/runtime'].version;
54+
// outputs the pnpm-workspace.yaml config as json
55+
const { stdout: configStdout } = await exec('pnpm config list --json');
56+
const pnpmWorkspaceConfig = JSON.parse(configStdout);
57+
babelRuntimeVersion = pnpmWorkspaceConfig.catalog['@babel/runtime'];
5758
}
5859

5960
const babelConfigPath = path.resolve(getWorkspaceRoot(), 'babel.config.js');

0 commit comments

Comments
 (0)