Author:
    Creation:2026-01-21Last update:2026-06-25

    vite-intlayer Package

    The vite-intlayer package provides a Vite plugin to integrate Intlayer into your Vite-based application. It handles dictionary compilation, dev-server watching, module aliases, locale-routing middleware, and build-time optimisations (tree-shaking, minification).

    Installation

    bash
    npm install vite-intlayer
    

    Exports

    Plugins

    Import:

    ts
    import { ... } from "vite-intlayer";
    
    ExportDescriptionRelated Doc
    intlayerMain Vite plugin. Prepares dictionaries, configures aliases, starts dev-server watchers, and (since v9) bundles the proxy and compiler.intlayer
    intlayerPlugin(Deprecated) Alias for intlayer.intlayer
    intLayerPlugin(Deprecated) Alias for intlayer.intlayer
    intlayerProxyLocale-routing middleware plugin (detection, redirect, rewrite). Since v9 it is bundled inside intlayer() – register separately only if needed.intlayerProxy
    intlayerMiddleware(Deprecated) Alias for intlayerProxy.intlayerProxy
    intLayerMiddlewarePlugin(Deprecated) Alias for intlayerProxy.intlayerProxy
    intlayerCompilerExtracts inline content declarations from components and writes them to dictionaries. Since v9 it is bundled inside intlayer().intlayerCompiler
    intlayerPruneTree-shakes unused dictionary fields from the production bundle.intlayerPrune
    intlayerMinifyMinifies compiled dictionary JSON files and optionally mangles field names.intlayerMinify

    Utilities

    ExportDescriptionRelated Doc
    createIntlayerProxyHandlerReturns a framework-agnostic Node.js (req, res, next) middleware with locale-routing logic.intlayerProxy

    Types

    ExportDescription
    IntlayerPluginOptionsOptions accepted by intlayer(). Extends GetConfigurationOptions with compatCallers and proxy.
    IntlayerProxyPluginOptionsOptions accepted by intlayerProxy() and createIntlayerProxyHandler(). Includes ignore and configOptions.
    IntlayerCompilerOptionsOptions accepted by intlayerCompiler(). Includes configOptions and compilerConfig.
    CompatCallerConfigRe-export from @intlayer/babel. Describes a compat-adapter caller pattern for field-usage analysis.