diff --git a/compiler/packages/react-compiler-runtime/scripts/build.js b/compiler/packages/react-compiler-runtime/scripts/build.js deleted file mode 100755 index d1c7dd5456e1..000000000000 --- a/compiler/packages/react-compiler-runtime/scripts/build.js +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env node - -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -const esbuild = require('esbuild'); -const yargs = require('yargs'); -const path = require('path'); -const {Generator} = require('npm-dts'); - -const argv = yargs(process.argv.slice(2)) - .options('w', { - alias: 'watch', - default: false, - type: 'boolean', - }) - .parse(); - -const config = { - entryPoints: [path.join(__dirname, '../src/index.ts')], - outfile: path.join(__dirname, '../dist/index.js'), - bundle: true, - external: ['react'], - format: 'cjs', - platform: 'node', - target: 'es6', - banner: { - js: `/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @lightSyntaxTransform - * @noflow - * @nolint - * @preventMunge - * @preserve-invariant-messages - */ - -"use no memo";`, - }, -}; - -async function main() { - if (argv.w) { - const ctx = await esbuild.context(config); - await ctx.watch(); - console.log('watching for changes...'); - } else { - await esbuild.build({ - sourcemap: true, - minify: false, - ...config, - }); - await new Generator({ - entry: 'src/index.ts', - output: 'dist/index.d.ts', - }).generate(); - } -} - -main(); diff --git a/compiler/packages/react-compiler-runtime/tsup.config.ts b/compiler/packages/react-compiler-runtime/tsup.config.ts index 6ebe42e08982..ebc8df6f14e6 100644 --- a/compiler/packages/react-compiler-runtime/tsup.config.ts +++ b/compiler/packages/react-compiler-runtime/tsup.config.ts @@ -9,7 +9,7 @@ export default defineConfig({ dts: false, bundle: true, format: 'cjs', - platform: 'browser', + platform: 'node', target: 'es2015', banner: { js: `/**