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";
    Export Description Related Doc
    intlayer Main 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
    intlayerProxy Locale-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
    intlayerCompiler Extracts inline content declarations from components and writes them to dictionaries. Since v9 it is bundled inside intlayer(). intlayerCompiler
    intlayerPrune Tree-shakes unused dictionary fields from the production bundle. intlayerPrune
    intlayerMinify Minifies compiled dictionary JSON files and optionally mangles field names. intlayerMinify

    Utilities

    Export Description Related Doc
    createIntlayerProxyHandler Returns a framework-agnostic Node.js (req, res, next) middleware with locale-routing logic. intlayerProxy

    Types

    Export Description
    IntlayerPluginOptions Options accepted by intlayer(). Extends GetConfigurationOptions with compatCallers and proxy.
    IntlayerProxyPluginOptions Options accepted by intlayerProxy() and createIntlayerProxyHandler(). Includes ignore and configOptions.
    IntlayerCompilerOptions Options accepted by intlayerCompiler(). Includes configOptions and compilerConfig.
    CompatCallerConfig Re-export from @intlayer/babel. Describes a compat-adapter caller pattern for field-usage analysis.