nx-plugins icon indicating copy to clipboard operation
nx-plugins copied to clipboard

Fires only when entries changes in watch mode

Open luokebi opened this issue 1 year ago • 6 comments

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

luokebi avatar Feb 22 '23 04:02 luokebi

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.

linbudu599 avatar Mar 03 '23 12:03 linbudu599

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.

linbudu599 avatar Mar 06 '23 13:03 linbudu599

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 avatar Mar 07 '23 12:03 linbudu599

@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?

countzero avatar Mar 31 '23 09:03 countzero

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

BlueGreenMagick avatar Apr 23 '23 04:04 BlueGreenMagick

See also https://github.com/evanw/esbuild/issues/2823

muffinresearch avatar Jul 05 '23 19:07 muffinresearch