svelte-cli icon indicating copy to clipboard operation
svelte-cli copied to clipboard

Watch Mode?

Open ChrisTalman opened this issue 8 years ago • 2 comments

Should the CLI include a -watch option? It could be useful during development. It could be similar to watch in TypeScript.

ChrisTalman avatar Jun 17 '17 20:06 ChrisTalman

It could do, yeah. watch modes can get surprisingly complicated — the built-in fs.watch is unreliable on some platforms so you sometimes have to use something like chokidar, which can also be a bit of a pain, and you have to handle all kinds of weird cases like files being renamed, files being created in a watched directory, etc.

So we haven't bothered with that yet because for the most part it's best left to things like webpack and Rollup (with rollup-watch) — they've already solved these problems, and have extra features (like CSS extraction) that are maybe a little harder to do via a CLI.

But it would be a good addition in the longer term. PRs always welcome! 😀

Rich-Harris avatar Jun 18 '17 17:06 Rich-Harris

Yeh I'm using rollup-watch (with rollup-plugin-svelte of course). Single responsibility principle?

ScottMaclure avatar Jul 27 '17 02:07 ScottMaclure