Skip to content

Commit

Permalink
chore: ignorePath to Options
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinbao1001 committed Jul 24, 2024
1 parent 346013c commit b8abf47
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions crates/binding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ pub struct BuildParams {
};
watch?: {
ignoredPaths?: string[];
nodeModulesRegexes?: string[];
};
}"#)]
pub config: serde_json::Value,
Expand Down
4 changes: 2 additions & 2 deletions crates/mako/src/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ pub struct ExperimentalConfig {
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct WatchConfig {
pub ignore_paths: Vec<String>,
pub node_modules_regexes: Vec<String>,
pub ignore_paths: Option<Vec<String>>,
pub node_modules_regexes: Option<Vec<String>>,
}

#[derive(Deserialize, Serialize, Debug)]
Expand Down
4 changes: 4 additions & 0 deletions crates/mako/src/dev/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<Regex>>(),
Expand Down Expand Up @@ -125,6 +127,8 @@ impl<'a> Watcher<'a> {
.config
.watch
.ignore_paths
.as_deref()
.unwrap_or(&[])
.iter()
.map(|p| p.as_str()),
);
Expand Down
1 change: 1 addition & 0 deletions packages/mako/binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export interface BuildParams {
};
watch?: {
ignoredPaths?: string[];
nodeModulesRegexes?: string[];
};
};
plugins: Array<JsHooks>;
Expand Down

0 comments on commit b8abf47

Please sign in to comment.