Skip to content

Commit b192dc8

Browse files
authored
fix(es/minifier): Make inline_globals noop by default (#10231)
**Related issue:** - Closes #10230
1 parent c9a6c23 commit b192dc8

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

bindings/binding_core_wasm/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ export interface GlobalPassOption {
924924
/**
925925
* Name of environment variables to inline.
926926
*
927-
* Defaults to `["NODE_ENV", "SWC_ENV"]`
927+
* Defaults to `[]`
928928
*/
929929
envs?: string[] | Record<string, string>;
930930
}

bindings/binding_minifier_wasm/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ export interface GlobalPassOption {
925925
/**
926926
* Name of environment variables to inline.
927927
*
928-
* Defaults to `["NODE_ENV", "SWC_ENV"]`
928+
* Defaults to `[]`
929929
*/
930930
envs?: string[] | Record<string, string>;
931931
}

crates/swc/src/config/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::{
2-
collections::{HashMap, HashSet},
2+
collections::HashMap,
33
env,
44
path::{Path, PathBuf},
55
sync::Arc,
@@ -1568,11 +1568,7 @@ pub enum GlobalInliningPassEnvs {
15681568

15691569
impl Default for GlobalInliningPassEnvs {
15701570
fn default() -> Self {
1571-
let mut v = HashSet::default();
1572-
v.insert(String::from("NODE_ENV"));
1573-
v.insert(String::from("SWC_ENV"));
1574-
1575-
GlobalInliningPassEnvs::List(v)
1571+
GlobalInliningPassEnvs::List(Default::default())
15761572
}
15771573
}
15781574

0 commit comments

Comments
 (0)