Skip to content

Commit 1f8087c

Browse files
committed
[rcr] Always target node
Alternative to #32071. As a follow up to #31993, the `platform` target was incorrectly being set to `browser` since it was the default argument for the build script. This corrects it to `node` and `cjs` which I think should resolve node 20 issues.
1 parent 5b51a2b commit 1f8087c

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

compiler/packages/react-compiler-runtime/scripts/build.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ const path = require('path');
1313
const {Generator} = require('npm-dts');
1414

1515
const argv = yargs(process.argv.slice(2))
16-
.options('p', {
17-
alias: 'platform',
18-
default: 'browser',
19-
choices: ['browser', 'node'],
20-
})
2116
.options('w', {
2217
alias: 'watch',
2318
default: false,
@@ -31,7 +26,7 @@ const config = {
3126
bundle: true,
3227
external: ['react'],
3328
format: 'cjs',
34-
platform: argv.p,
29+
platform: 'node',
3530
target: 'es6',
3631
banner: {
3732
js: `/**

compiler/packages/snap/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
],
1111
"scripts": {
1212
"postinstall": "./scripts/link-react-compiler-runtime.sh && perl -p -i -e 's/react\\.element/react.transitional.element/' ../../node_modules/fbt/lib/FbtReactUtil.js && perl -p -i -e 's/didWarnAboutUsingAct = false;/didWarnAboutUsingAct = true;/' ../../node_modules/react-dom/cjs/react-dom-test-utils.development.js",
13-
"build": "rimraf dist && concurrently -n snap,runtime \"tsc --build\" \"yarn --silent workspace react-compiler-runtime build -p node\"",
13+
"build": "rimraf dist && concurrently -n snap,runtime \"tsc --build\" \"yarn --silent workspace react-compiler-runtime build\"",
1414
"test": "echo 'no tests'",
1515
"prettier": "prettier --write 'src/**/*.ts'"
1616
},

0 commit comments

Comments
 (0)