import fs from 'node:fs'; import { transformSync } from '@babel/core'; import compiler from 'babel-plugin-react-compiler'; const result = transformSync(fs.readFileSync('src/main.jsx', 'utf8'), { filename: 'src/main.jsx', plugins: [[compiler, { target: '19' }]], parserOpts: { plugins: ['jsx'] }, configFile: false, babelrc: false, }); fs.writeFileSync('src/compiled.jsx', result.code + '\n'); console.log('Compiler output written to src/compiled.jsx');