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
feat(cli-hooks): add default app and manifest watch config
6
+
7
+
This package now provides default watch configurations for automatic file watching during [`slack run`](https://docs.slack.dev/tools/slack-cli/reference/commands/slack_platform_run). The CLI will restart your app server when source files change and reinstall your app when the manifest changes.
8
+
9
+
**Requirements:** These features require Slack CLI v3.12.0+ with [file watching support](https://github.com/slackapi/slack-cli/pull/310).
10
+
11
+
### Default Configuration
12
+
13
+
The following watch settings are provided automatically when using this package:
14
+
15
+
```json
16
+
{
17
+
"config": {
18
+
"watch": {
19
+
"app": {
20
+
"filter-regex": "\\.js$",
21
+
"paths": ["."]
22
+
},
23
+
"manifest": {
24
+
"paths": ["manifest.json"]
25
+
}
26
+
}
27
+
}
28
+
}
29
+
```
30
+
31
+
-**app**: Watches for JavaScript file changes to restart the app server
32
+
-**manifest**: Watches the manifest file for changes to reinstall the app
33
+
34
+
**Note:** Manifest watching requires a local manifest source in your `.slack/config.json` file. Remote manifests will not be updated on file changes.
35
+
36
+
```json
37
+
{
38
+
"manifest": {
39
+
"source": "local"
40
+
}
41
+
}
42
+
```
43
+
44
+
### Custom Configurations
45
+
46
+
You can override these defaults in your `.slack/hooks.json` file to reduce the paths searched or change the file patterns. Read [Watch Configurations](https://docs.slack.dev/tools/slack-cli/reference/hooks/#watch-configurations) for more options.
47
+
48
+
### TypeScript Development
49
+
50
+
TypeScript developers should run `tsc --watch` in a separate terminal during development. This compiles `.ts` files to `.js` on changes, and the default watch configuration will detect changes to the compiled `dist/*.js` files and restart the app server. This approach works best with the default settings.
0 commit comments