File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,10 @@ where
146146 // Add the book.toml file to the watcher if it exists
147147 let _ = watcher. watch ( book. root . join ( "book.toml" ) , NonRecursive ) ;
148148
149+ for dir in & book. config . build . extra_watch_dirs {
150+ let _ = watcher. watch ( dir, Recursive ) ;
151+ }
152+
149153 info ! ( "Listening for changes..." ) ;
150154
151155 loop {
Original file line number Diff line number Diff line change @@ -437,6 +437,8 @@ pub struct BuildConfig {
437437 /// Should the default preprocessors always be used when they are
438438 /// compatible with the renderer?
439439 pub use_default_preprocessors : bool ,
440+ /// Extra directories to trigger rebuild when watching/serving
441+ pub extra_watch_dirs : Vec < PathBuf > ,
440442}
441443
442444impl Default for BuildConfig {
@@ -445,6 +447,7 @@ impl Default for BuildConfig {
445447 build_dir : PathBuf :: from ( "book" ) ,
446448 create_missing : true ,
447449 use_default_preprocessors : true ,
450+ extra_watch_dirs : Vec :: new ( ) ,
448451 }
449452 }
450453}
You can’t perform that action at this time.
0 commit comments