Skip to content

Commit 813ab08

Browse files
authored
docs: note bundlers must keep node-cron external for background tasks (node-cron#610)
1 parent ee9d294 commit 813ab08

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Pass a file path instead of a function to run a job in an isolated forked proces
5555
cron.schedule('0 3 * * *', './tasks/backup.js');
5656
```
5757

58+
> **Bundlers:** background tasks fork a helper that node-cron resolves relative to its own files in `node_modules`. If you bundle your app (esbuild, webpack, Rollup, etc.), mark node-cron as external so it stays on disk (`--external:node-cron`, or `externals: ['node-cron']` in webpack). Otherwise the fork fails with `Cannot find module '.../daemon.js'`. Inline function tasks are unaffected.
59+
5860
## Runtime Control
5961

6062
Every task exposes a single consistent interface for control and inspection:

0 commit comments

Comments
 (0)