Open mrgrain opened 1 year ago
Are you proposing to make these external APIs? Why not make watch
ing assets the default behavior of cdk watch
?
Are you proposing to make these external APIs? Why not make
watch
ing assets the default behavior ofcdk watch
?
They probably should be public so any custom asset could implement them if desired.
Adding an implementation to the assets bundled in the CDK would make it the default behavior for those assets.
Describe the feature
An API for asset bundling to hook into the watch/hotswap feature to create an incremental build of the asset.
Use Case
Asset bundling can be expensive. While some providers (e.g. Docker) already use an internal cache to build increments, not all do and it is the responsibility of the provider to store state.
A concrete would be bundling a lambda function with esbuild. This could use esbuild's native watch feature to update assets instead of always doing a full build. Or it could rely on CDKs file watcher, but trigger a rebuild when one of its files changed.
Proposed Solution
Maybe two variations
Other Information
No response
Acknowledgements
CDK version used
n/a
Environment details (OS name and version, etc.)
n/a