-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Is there an existing issue for this?
- I have searched the existing issues
Feature description
I would like the ability to specify one or more “patterns” that limit which file changes trigger a hot reload with LocalStack Lambdas. For example, this could be implemented to accept a comma-separated list of Python standard library globs:
LAMBDA_HOT_RELOAD_PATTERNS=**/dist/**/*.js
Using this setting, only changes to .js files under a dist folder would cause a hot reload.
I have a Node.js monorepo which includes workspaces which depend on each other. pnpm creates symlinks under one workspace’s node_modules folder to another, for example packages/a/node_modules/@myapp/b is a symlink to ../../../../packages/b.
If I want to launch a lambda with code under packages/a I have to set the s3 key in my hot-reload bucket to the project root, otherwise the symlink to ../../../../packages/b won’t resolve as that file won’t exist under the lambda container /var/task directory.
Setting the S3 key to the project root works fine, but my project root contains lots of other files which change often and have no impact on my lambda (eg. files in other projects, log files under the localstack dir, etc.).
Being able to configure a pattern to narrow which files the hot reload file watcher cares about would prevent unnecessary reloads and speed up my development loop.
The globs would be relative to the /var/task folder, so I could instead have specified packages/*/dist/**/*.js if I wanted to be more specific, or **/dist/** if I wanted to be even less specific (in case I had other non-JS files in my build dir that I want to trigger hot reloads).
🧑💻 Implementation
No response
Anything else?
No response