You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorialkit.dev/src/content/docs/reference/configuration.mdx
+7-2
Original file line number
Diff line number
Diff line change
@@ -284,13 +284,15 @@ An example use case is when a user runs a command that modifies a file. For inst
284
284
285
285
This property is by default set to `false` as it can impact performance. If you are creating a lesson where the user is expected to modify files outside the editor, you may want to keep this to `false`.
286
286
287
+
If you would like files to be added or removed from the editor automatically, you need to specify an array of globs that will determine which folders and files to watch for changes.
288
+
287
289
<PropertyTable inherited type={'FileSystem'} />
288
290
289
291
The `FileSystem` type has the following shape:
290
292
291
293
```ts
292
294
type FileSystem = {
293
-
watch: boolean
295
+
watch: boolean | string[]
294
296
}
295
297
296
298
```
@@ -299,10 +301,13 @@ Example values:
299
301
300
302
```yaml
301
303
filesystem:
302
-
watch: true # Filesystem changes are reflected in the editor
304
+
watch: true # Filesystem changes to files already in the editor are reflected in the editor
303
305
304
306
filesystem:
305
307
watch: false # Or if it's omitted, the default value is false
308
+
309
+
filesystem:
310
+
watch: ['/*.json', '/src/**/*'] # Files changed, added or deleted that match one of the globs are updated in the editor
Copy file name to clipboardExpand all lines: packages/types/src/schemas/common.ts
+5-3
Original file line number
Diff line number
Diff line change
@@ -58,9 +58,11 @@ export type PreviewSchema = z.infer<typeof previewSchema>;
58
58
59
59
exportconstfileSystemSchema=z.object({
60
60
watch: z
61
-
.boolean()
62
-
.optional()
63
-
.describe('When set to true, file changes in WebContainer are updated in the editor as well.'),
61
+
.union([z.boolean(),z.array(z.string())])
62
+
.describe(
63
+
'When set to true, file changes in WebContainer are updated in the editor as well. When set to an array, file changes or new files in the matching paths are updated in the editor.',
0 commit comments