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

esbuild-plugin-html only watches the HTML file #160

Closed
louyshong opened this issue Nov 22, 2023 · 7 comments · Fixed by #169
Closed

esbuild-plugin-html only watches the HTML file #160

louyshong opened this issue Nov 22, 2023 · 7 comments · Fixed by #169

Comments

@louyshong
Copy link

Hi, I am struggling to setup watch mode using esbuild-plugin-html, it seems that only the HTML files specified in the entryPoints are being watched but not the JS files that are included in the script tags. Is this behaviour expected?

@cowwoc
Copy link
Contributor

cowwoc commented Mar 5, 2024

I am having the same problem. This is a showstopper for using this plugin.

@edoardocavazza can you please take a look?

@cowwoc
Copy link
Contributor

cowwoc commented Mar 5, 2024

Looking forward to trying out this fix. Do you plan to cut a release layer on today?

@edoardocavazza
Copy link
Member

Hello @cowwoc, I have just released version 0.18.1. Let me know if it works as expected or feel free to re-open the issue.

@cowwoc
Copy link
Contributor

cowwoc commented Mar 5, 2024

Hi @edoardocavazza

I don't have permission to reopen this issue, but the bug is still there. I am passing in an HTML entry point that contains:

<script type="module" src="./bundle-shoelace.mts" defer></script>

However, when I modify bundle-shoelace.mts nothing happens. If I edit the HTML directly, then the changes get picked up. So esbuild watch is doing the right thing, but this plugin isn't working as expected...

@cowwoc
Copy link
Contributor

cowwoc commented Mar 5, 2024

I think I found the bug.

At

watchFiles.push();

you need to replace watchFiles.push(); with watchFiles.push(file);

@cowwoc
Copy link
Contributor

cowwoc commented Mar 5, 2024

I just tested the fix locally. It works!

cowwoc added a commit to cowwoc/rna that referenced this issue Mar 5, 2024
@cowwoc
Copy link
Contributor

cowwoc commented Mar 5, 2024

Please merge #173 and cut a new release. Thank you.

edoardocavazza added a commit that referenced this issue Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants