modernweb-dev / web

Guides, tools and libraries for modern web development.
https://modern-web.dev
MIT License
2.2k stars 278 forks source link

[dev-server] Add option to watch a list of files using a glob pattern #1359

Open lubomirblazekcz opened 3 years ago

lubomirblazekcz commented 3 years ago

I tried both rollup-plugin-postcss and rollup-plugin-styles and they work fine, but watch is not triggered in files that are imported inside the styles. Which is currently big drawback with using buildless css with dev server.

This could be eaisly resolved if it would be possible to set which files should be watched.

LarsDenBakker commented 3 years ago

The server watches all files that are served. I guess these plugins bundle the imports, so that the CSS files are never actually served? Then the only way to handle this is to add support for providing a glob of extra files to watch.

lubomirblazekcz commented 3 years ago

Yes, they bundle the imports - this can be disabled, but thats not the solution because css imports expect css MIME. So that doesn't work.

Only solution is adding a glob of extra files to watch, that would be great!