Skip to content

Commit

Permalink
[rcr] Always target node (#32091)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
poteto authored Jan 16, 2025
1 parent e5fdd99 commit 35dcf02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions compiler/packages/react-compiler-runtime/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ const path = require('path');
const {Generator} = require('npm-dts');

const argv = yargs(process.argv.slice(2))
.options('p', {
alias: 'platform',
default: 'browser',
choices: ['browser', 'node'],
})
.options('w', {
alias: 'watch',
default: false,
Expand All @@ -31,7 +26,7 @@ const config = {
bundle: true,
external: ['react'],
format: 'cjs',
platform: argv.p,
platform: 'node',
target: 'es6',
banner: {
js: `/**
Expand Down
2 changes: 1 addition & 1 deletion compiler/packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"scripts": {
"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",
"build": "rimraf dist && concurrently -n snap,runtime \"tsc --build\" \"yarn --silent workspace react-compiler-runtime build -p node\"",
"build": "rimraf dist && concurrently -n snap,runtime \"tsc --build\" \"yarn --silent workspace react-compiler-runtime build\"",
"test": "echo 'no tests'",
"prettier": "prettier --write 'src/**/*.ts'"
},
Expand Down

0 comments on commit 35dcf02

Please sign in to comment.