interface Options {
    cacheDir?: string;
    cwd?: string;
    enforce?: "pre" | "post";
    externalizeDeps?: (string | RegExp)[];
    externals?: Record<string, any>;
    interop?: "auto";
    mode?: string;
    nodeBuiltins?: boolean;
    [mode: string]: BasicOptions | any;
}

Hierarchy (view full)

Indexable

[mode: string]: BasicOptions | any

External dependencies for specific mode

针对指定的模式配置外部依赖

Properties

cacheDir?: string

Cache folder

缓存文件夹

Default

${cwd}/node_modules/.vite_external

cwd?: string

The current working directory in which to join cacheDir.

用于拼接 cacheDir 的路径。

Default

process.cwd()

enforce?: "pre" | "post"

The value of enforce can be either "pre" or "post", see more at https://vitejs.dev/guide/api-plugin.html#plugin-ordering.

强制执行顺序,pre 前,post 后,参考 https://cn.vitejs.dev/guide/api-plugin.html#plugin-ordering。

externalizeDeps?: (string | RegExp)[]

Specify dependencies to not be included in the bundle

排除不需要打包的依赖。

externals?: Record<string, any>

External dependencies

配置外部依赖

interop?: "auto"

Controls how Rollup handles default.

用于控制读取外部依赖的默认值。

mode?: string

Different externals can be specified in different modes.

在不同的模式下,可以指定不同的外部依赖。

nodeBuiltins?: boolean

Whether to exclude nodejs built-in modules in the bundle

是否排除 nodejs 内置模块。

Generated using TypeDoc