@samitouri / QOS-React-1 / commits / 35dcf02b04

[rcr] Always target node (#32091)

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.

lauren committed Jan 16, 2025 at 13:37 UTC 35dcf02b04b3b5c539f666b86dd1910ddcee9c89
2 files changed +2 -7
compiler/packages/react-compiler-runtime/scripts/build.js
+1 -6
@@ -13,11 +13,6 @@ const path = require('path');
13 const {Generator} = require('npm-dts');
14
15 const argv = yargs(process.argv.slice(2))
16 - .options('p', {
17 - alias: 'platform',
18 - default: 'browser',
19 - choices: ['browser', 'node'],
20 - })
16 .options('w', {
17 alias: 'watch',
18 default: false,
@@ -31,7 +26,7 @@ const config = {
26 bundle: true,
27 external: ['react'],
28 format: 'cjs',
34 - platform: argv.p,
29 + platform: 'node',
30 target: 'es6',
31 banner: {
32 js: `/**
compiler/packages/snap/package.json
+1 -1
@@ -10,7 +10,7 @@
10 ],
11 "scripts": {
12 "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\"",
14 "test": "echo 'no tests'",
15 "prettier": "prettier --write 'src/**/*.ts'"
16 },