eleventy-dev-server icon indicating copy to clipboard operation
eleventy-dev-server copied to clipboard

Eleventy Dev Server - CLI and watch option

Open jeromecoupe opened this issue 2 years ago • 0 comments

This is a clarification rather than an issue I guess

Testing Eleventy 2.0.0@beta and Eleventy Dev Server 1.0.0, particularly the watch option in conjunction with external NPM scripts for CSS and JS processing. Can I use the --watch flag with the CLI or is the --dir flag the intended method for now ?

Everything works smoothly by doing npx @11ty/eleventy --serve with a JS configuration and setServerOptions

eleventyConfig.setServerOptions({
  watch: ["./dist/assets/css/**/*.css", "./dist/assets/js/**/*.js"],
  port: 3000,
});

Things are working as well with the CLI using a global --dir=\"./dist/\" flag

In some contexts, it would be great to be able to use the --watch flag with an array of globs (to watch files that are not necessarily in a single folder). Is that possible now / could be implemented down the line ? Looked at the Eleventy Dev Server man page but didn't see a way to do it.

jeromecoupe avatar Jan 20 '23 08:01 jeromecoupe