UNPKG

vite-intlayer

Version:

A Vite plugin for seamless internationalization (i18n), providing locale detection, redirection, and environment-based configuration

48 lines (46 loc) 1.37 kB
import { GetConfigurationOptions } from "@intlayer/config"; import { CompilerConfig } from "@intlayer/types"; //#region src/IntlayerCompilerPlugin.d.ts /** * Mode of the compiler * - 'dev': Development mode with HMR support * - 'build': Production build mode */ type CompilerMode = 'dev' | 'build'; /** * Options for initializing the compiler */ type IntlayerCompilerOptions = { /** * Configuration options for getting the intlayer configuration */ configOptions?: GetConfigurationOptions; /** * Custom compiler configuration to override defaults */ compilerConfig?: Partial<CompilerConfig>; }; /** * Create an IntlayerCompiler - A Vite-compatible compiler plugin for Intlayer * * This autonomous compiler handles: * - Configuration loading and management * - Hot Module Replacement (HMR) for content changes * - File transformation with content extraction * - Dictionary persistence and building * * @example * ```ts * // vite.config.ts * import { defineConfig } from 'vite'; * import { intlayerCompiler } from 'vite-intlayer'; * * export default defineConfig({ * plugins: [intlayerCompiler()], * }); * ``` */ declare const intlayerCompiler: (options?: IntlayerCompilerOptions) => any; //#endregion export { CompilerMode, IntlayerCompilerOptions, intlayerCompiler }; //# sourceMappingURL=IntlayerCompilerPlugin.d.ts.map