diff --git a/crates/binding/src/lib.rs b/crates/binding/src/lib.rs index 90a76dfd7..38242612a 100644 --- a/crates/binding/src/lib.rs +++ b/crates/binding/src/lib.rs @@ -168,6 +168,7 @@ pub struct BuildParams { }; watch?: { ignoredPaths?: string[]; + nodeModulesRegexes?: string[]; }; }"#)] pub config: serde_json::Value, diff --git a/crates/mako/src/config/config.rs b/crates/mako/src/config/config.rs index 08f38c126..08c815f1b 100644 --- a/crates/mako/src/config/config.rs +++ b/crates/mako/src/config/config.rs @@ -445,8 +445,8 @@ pub struct ExperimentalConfig { #[derive(Deserialize, Serialize, Debug)] #[serde(rename_all = "camelCase")] pub struct WatchConfig { - pub ignore_paths: Vec, - pub node_modules_regexes: Vec, + pub ignore_paths: Option>, + pub node_modules_regexes: Option>, } #[derive(Deserialize, Serialize, Debug)] diff --git a/crates/mako/src/dev/watch.rs b/crates/mako/src/dev/watch.rs index e1aee98c7..a62fb52d8 100644 --- a/crates/mako/src/dev/watch.rs +++ b/crates/mako/src/dev/watch.rs @@ -39,6 +39,8 @@ impl<'a> Watcher<'a> { .config .watch .node_modules_regexes + .clone() + .unwrap_or_default() .iter() .map(|s| Regex::new(s).unwrap()) .collect::>(), @@ -125,6 +127,8 @@ impl<'a> Watcher<'a> { .config .watch .ignore_paths + .as_deref() + .unwrap_or(&[]) .iter() .map(|p| p.as_str()), ); diff --git a/packages/mako/binding.d.ts b/packages/mako/binding.d.ts index 2f8916ca1..55598dfd6 100644 --- a/packages/mako/binding.d.ts +++ b/packages/mako/binding.d.ts @@ -183,6 +183,7 @@ export interface BuildParams { }; watch?: { ignoredPaths?: string[]; + nodeModulesRegexes?: string[]; }; }; plugins: Array;