fix(node-swc): Sync types for jsc.optimizer.globals (#6603)

This commit is contained in:
meskill 2022-12-09 01:15:02 +01:00 committed by GitHub
parent fbf83db0e7
commit b97aa45c5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -879,18 +879,25 @@ export interface OptimizerConfig {
*/
export interface GlobalPassOption {
/**
* Global variables.
* Global variables that should be inlined with passed value.
*
* e.g. `{ __DEBUG__: true }`
*/
vars?: { [key: string]: string };
vars?: Record<string, string>;
/**
* Name of environment variables to inline.
* Names of environment variables that should be inlined with the value of corresponding env during build.
*
* Defaults to `["NODE_ENV", "SWC_ENV"]`
*/
envs?: string[];
/**
* Replaces typeof calls for passed variables with corresponding value
*
* e.g. `{ window: 'object' }`
*/
typeofs?: Record<string, string>;
}
export type ModuleConfig = Es6Config | CommonJsConfig | UmdConfig | AmdConfig | NodeNextConfig | SystemjsConfig;