File tree Expand file tree Collapse file tree 1 file changed +20
-17
lines changed Expand file tree Collapse file tree 1 file changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -107,24 +107,27 @@ export function createRoutesContext(options: ResolvedOptions) {
107
107
)
108
108
} ) ,
109
109
...( options . experimental . paramParsers ?. dir . map ( ( folder ) => {
110
- watchers . push (
111
- setupParamParserWatcher (
112
- fsWatch ( '.' , {
113
- cwd : folder ,
114
- ignoreInitial : true ,
115
- ignorePermissionErrors : true ,
116
- ignored : ( filePath , stats ) => {
117
- // let folders pass, they are ignored by the glob pattern
118
- if ( ! stats || stats . isDirectory ( ) ) {
119
- return false
120
- }
121
-
122
- return ! isParamParserMatch ( relative ( folder , filePath ) )
123
- } ,
124
- } ) ,
125
- folder
110
+ if ( startWatchers ) {
111
+ watchers . push (
112
+ setupParamParserWatcher (
113
+ fsWatch ( '.' , {
114
+ cwd : folder ,
115
+ ignoreInitial : true ,
116
+ ignorePermissionErrors : true ,
117
+ ignored : ( filePath , stats ) => {
118
+ // let folders pass, they are ignored by the glob pattern
119
+ if ( ! stats || stats . isDirectory ( ) ) {
120
+ return false
121
+ }
122
+
123
+ return ! isParamParserMatch ( relative ( folder , filePath ) )
124
+ } ,
125
+ } ) ,
126
+ folder
127
+ )
126
128
)
127
- )
129
+ }
130
+
128
131
return glob ( PARAM_PARSER_GLOB , {
129
132
cwd : folder ,
130
133
onlyFiles : true ,
You can’t perform that action at this time.
0 commit comments