11ty / 11ty/dev-server

Eleventy Dev Server - CLI and watch option

Open
#45 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs-votes
Dominant language
JavaScript
Stars
109
Forks
20
Avg merge
1m
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the CLI handling of --watch and --dir with the setServerOptions({ watch }) configuration described in the issue, then check the Eleventy Dev Server man page. Done means the supported behavior for watching an array of external globs is documented or implemented, with the CLI and configuration paths agreeing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.