Skip to content

Commit c3b4b50

Browse files
author
Brijesh Bittu
committed
Use babel/runtime version specified in pnpm-workspace.yaml
1 parent 14f91b3 commit c3b4b50

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
@@ -47,9 +47,10 @@ async function run(argv) {
4747
);
4848
} else if (babelRuntimeVersion === 'catalog:') {
4949
// resolve the version from the given package
50-
const { stdout: listedBabelRuntime } = await exec('pnpm list "@babel/runtime" --json');
51-
const jsonListedDependencies = JSON.parse(listedBabelRuntime);
52-
babelRuntimeVersion = jsonListedDependencies[0].dependencies['@babel/runtime'].version;
50+
// outputs the pnpm-workspace.yaml config as json
51+
const { stdout: configStdout } = await exec('pnpm config list --json');
52+
const pnpmWorkspaceConfig = JSON.parse(configStdout);
53+
babelRuntimeVersion = pnpmWorkspaceConfig.catalog['@babel/runtime'];
5354
}
5455

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

0 commit comments

Comments
 (0)