nx-plugins
nx-plugins copied to clipboard
Fires only when entries changes in watch mode
esbuild version: 0.17.10 use watch mode like this: https://esbuild.github.io/api/#watch
Copy only fires the first time. Not fire when the assets changes
This is a feature should be provided in the 2 major verison but I just forgot that one😢, gonna support that in 2.1.0.
It seems that ESBuild will re-execute all plugin when files under absWorkingDir changed in watching mode, so copy-on-change should only works for the files outside absWorkingDir, uh-huh but it's still useful in some cases.
The copy-on-watch feature was supported in 2.1.0 now, I've checked in several cases but there might be missing ones, if you got any troubles, please report in this issue and I'd keep it open for a long time.
@linbudu599 I am not sure, if this is related. I am using the following configuration
esbuild version: 0.17.14 esbuild-plugin-copy version: 2.1.1 use watch mode like this: https://esbuild.github.io/api/#watch
But the plugin does not start watching correctly. The info message is:
Watching mode disabled. You need to enable build.watch option for watch mode to work.
Should this not be supported as of 2.1.0?
The plugin is copying all resource files each time rebuild is triggered due to watch. build.onStart and build.onEnd is triggered on each rebuild. I think the asset copying should be done in setup(build) instead.
I am also unable to setbuild.watch option because esbuild disallows unknown flags on build options.
esbuild version: 0.17.17 esbuild-plugin-copy version: 2.1.1
See also https://github.com/evanw/esbuild/issues/2823