import { n as InputOptions, r as PresetItem } from "./babelCompat-D1BrUOe4.mjs"; import { GeneralHookFilter, ModuleTypeFilter, Plugin } from "rolldown"; import { Plugin as Plugin$1, ResolvedConfig } from "vite"; type PartialEnvironment = Parameters>[0]; type RolldownBabelPreset = { preset: PresetItem; rolldown: { filter?: { id?: GeneralHookFilter; moduleType?: ModuleTypeFilter; code?: GeneralHookFilter; }; optimizeDeps?: { include?: string[]; }; applyToEnvironmentHook?: (environment: PartialEnvironment) => boolean; configResolvedHook?: (config: ResolvedConfig) => boolean; }; }; type RolldownBabelPresetItem = PresetItem | RolldownBabelPreset; export declare function defineRolldownBabelPreset(preset: RolldownBabelPreset): RolldownBabelPreset; interface InnerTransformOptions extends Partial> { /** * List of presets (a set of plugins) to load and use * * Default: `[]` */ presets?: RolldownBabelPresetItem[] | undefined; } interface PluginOptions extends Omit { /** * When set, automatically adds `@babel/plugin-transform-runtime` so that * babel helpers are imported from `@babel/runtime` instead of being inlined * into every file. * * Requires `@babel/plugin-transform-runtime` and `@babel/runtime` to be installed. */ runtimeVersion?: string; /** * Transform files in worker threads. * Pass a number to set the worker count. * `true` uses the number of CPU cores, with a maximum of 4. * * All babel options must be structured-cloneable: * refer to plugins and presets by name, not by function. * Rolldown preset filters and hooks stay in the main thread. * @default false */ parallel?: boolean | number; /** * If specified, only files matching the pattern will be processed by babel. * @default `/\.(?:[jt]sx?|[cm][jt]s)(?:$|\?)/` * * Note that this option receives the syntax supported by babel instead of picomatch. * @see https://babeljs.io/docs/options#matchpattern */ include?: InnerTransformOptions["include"]; /** * If any of patterns match, babel will not process the file. * @default `/[\/\\]node_modules[\/\\]/` * * Note that this option receives the syntax supported by babel instead of picomatch. * @see https://babeljs.io/docs/options#matchpattern */ exclude?: InnerTransformOptions["exclude"]; /** * If false, skips source map generation. This will improve performance. * @default true */ sourceMap?: boolean; /** * Allows users to provide an array of options that will be merged into the current configuration one at a time. * This feature is best used alongside the "test"/"include"/"exclude" options to provide conditions for which an override should apply */ overrides?: InnerTransformOptions[] | undefined; } declare function babelPlugin(rawOptions: PluginOptions): Promise; export { type RolldownBabelPreset, babelPlugin as default };