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

Expose watch-debounce field to config? #9

Open
JudahGabriel opened this issue Nov 25, 2021 · 1 comment
Open

Expose watch-debounce field to config? #9

JudahGabriel opened this issue Nov 25, 2021 · 1 comment

Comments

@JudahGabriel
Copy link

I see there's an internal --watch-debounce internal config field, defaults to 100ms, but this value is not configurable by users.

Can we make this value configurable?

I'm seeing an issue with many of my projects where I save a single .ts file, and web dev server in watch mode restarts multiple times. Investigating the issue, the problem comes down to Typescript takes longer than 100ms between changes when writing the source map files, resulting in multiple reloads:

image

In the above screenshot, notice there is a > 100ms delay between the change of index.html and the change of pwabuilder-sw.js.map.

If I could control the watch debounce time, it would make my edit->debug->test cycle much smoother.

Would you accept a pull request enabling this?

@daKmoR
Copy link
Member

daKmoR commented Nov 25, 2021

in @web/dev-server which is the successor of es-dev-server it's a small plugin you could "fork" in your config and change to whatever logic/value you need

https://github.com/modernweb-dev/web/blob/master/packages/dev-server/src/plugins/watchPlugin.ts

PS: es-dev-server will likely not get any feature releases so it's probably best to move to @web/dev-server if possible

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

No branches or pull requests

2 participants