import { Plugin } from "vite"; import { MinifyOptions } from "oxc-minify"; import { NapiResolveOptions } from "oxc-resolver"; import { TransformOptions } from "oxc-transform"; //#region src/types.d.ts type FilterPattern = ReadonlyArray | string | RegExp | null; interface VitePluginOxcOptions { /** * Files to include for transformation * @default [/\.[cm]?[jt]sx?$/] */ include?: FilterPattern; /** * Files to exclude from transformation * @default [/node_modules/] */ exclude?: FilterPattern; /** * Plugin enforcement order */ enforce?: 'pre' | 'post'; /** * Transform options passed to oxc-transform * Set to false to disable transformation */ transform?: Omit | false; /** * Resolve options passed to oxc-resolver * Set to false to disable custom resolution */ resolve?: NapiResolveOptions | false; /** * Whether to resolve node_modules * The plugin skips resolving node_modules by default for performance * @default false */ resolveNodeModules?: boolean; /** * Minify options passed to oxc-minify * Set to false to disable minification * Set to true to use default minification options */ minify?: Omit | boolean; /** * Enable source map generation * @default true in development, false in production */ sourcemap?: boolean; /** * Enable React Fast Refresh in development mode * @default true */ reactRefresh?: boolean; } //#endregion //#region src/index.d.ts /** * Vite plugin for Oxc integration * * @example * ```ts * // vite.config.ts * import { defineConfig } from 'vite' * import oxc from 'vite-plugin-oxc' * * export default defineConfig({ * plugins: [oxc()], * }) * ``` */ declare function vitePluginOxc(rawOptions?: VitePluginOxcOptions): Plugin; //#endregion export { type VitePluginOxcOptions, vitePluginOxc as default };