Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(node-swc): sync available settings for optimizer.globals #6603

Merged
merged 1 commit into from Dec 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions node-swc/src/types.ts
Expand Up @@ -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;
Expand Down