import { PluginOptions } from "babel-plugin-react-compiler"; import { BabelPluginOptions } from "@powerlines/plugin-babel/types/plugin"; import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env/types/plugin"; //#region src/types/plugin.d.ts type ReactCompilerOptions = Omit; interface ReactPluginOptions { /** * Control where the JSX factory is imported from. * * @see https://esbuild.github.io/api/#jsx-import-source * * @defaultValue "react" */ jsxImportSource?: string; /** * Control how JSX is transformed. * * @remarks * Skipping React import with classic runtime is not supported from v4 * * @defaultValue "automatic" */ jsxRuntime?: "classic" | "automatic"; /** * Options provided to the [React Compiler](https://npmjs.com/package/babel-plugin-react-compiler). * * @see https://github.com/facebook/react/blob/main/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L55 * @see https://react.dev/blog/2025/04/21/react-compiler-rc * * @remarks * Set to `false` to disable the React Compiler. By default, the React Compiler is enabled and target is set to React 19. */ compiler?: ReactCompilerOptions | false; /** * React Fast Refresh runtime URL prefix. * * @remarks * Useful in a module federation context to enable HMR by specifying the host application URL in the Vite config of a remote application. * * @example * reactRefreshHost: 'http://localhost:3000' */ reactRefreshHost?: string; /** * Options to pass to the [Babel plugin](https://npmjs.com/package/\@powerlines/plugin-babel). */ babel?: Partial; /** * Options to pass to the [Env plugin](https://npmjs.com/package/\@powerlines/plugin-env). */ env?: Partial>; } type ReactPluginUserConfig = EnvPluginUserConfig & { /** * Options for the React plugin. */ react?: ReactPluginOptions; }; type ReactPluginResolvedConfig = EnvPluginResolvedConfig & { /** * Options for the React plugin. */ react: ReactPluginOptions; }; interface ReactPluginContext extends EnvPluginContext {} //#endregion export { ReactCompilerOptions, ReactPluginContext, ReactPluginOptions, ReactPluginResolvedConfig, ReactPluginUserConfig }; //# sourceMappingURL=plugin.d.mts.map