Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fires only when entries changes in watch mode #98

Open
luokebi opened this issue Feb 22, 2023 · 6 comments
Open

Fires only when entries changes in watch mode #98

luokebi opened this issue Feb 22, 2023 · 6 comments
Labels

Comments

@luokebi
Copy link

luokebi commented Feb 22, 2023

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

@linbudu599 linbudu599 added the WIP label Mar 3, 2023
@linbudu599
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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.

@countzero
Copy link

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

@BlueGreenMagick
Copy link

BlueGreenMagick commented Apr 23, 2023

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

@muffinresearch
Copy link

See also evanw/esbuild#2823

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants