vite-legacy-pass-through - v1.3.0
    Preparing search index...

    Variable DEFAULT_EXCLUDE_EXTENSIONSConst

    DEFAULT_EXCLUDE_EXTENSIONS: Set<string> = ...

    Vite plugin that marks legacy libraries as external, preventing Rolldown from bundling them and causing CommonJS interop errors at runtime.

    The plugin hooks into the resolveId phase with enforce: 'pre' and marks any import whose path starts with <lib>/ as external. Rolldown then skips those imports entirely, leaving them as bare import statements in the output.

    Rolldown does not recommend marking packages as external in library builds. Doing so shifts the module resolution responsibility to the consumer. Use this plugin only when the legacy library is guaranteed to be available in the target environment.

    Plugin configuration options.

    A Vite Plugin instance.

    If an option has an invalid runtime value.

    If libs is empty or contains only empty strings.

    // vite.config.ts
    import { defineConfig } from 'vite'
    import { legacyPassThrough } from 'vite-legacy-pass-through'

    export default defineConfig({
    plugins: [
    legacyPassThrough({
    libs: ['lib-legacy'],
    showLog: true,
    }),
    ],
    })