Skip to content

Pass --watcher only when the build watches - #680

Merged
tricknotes merged 1 commit into
mainfrom
pass-watcher-only-when-watching
Sep 11, 2026
Merged

Pass --watcher only when the build watches#680
tricknotes merged 1 commit into
mainfrom
pass-watcher-only-when-watching

Conversation

@tricknotes

@tricknotes tricknotes commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Command#ember_build puts --watcher on the command line whenever a watcher is configured, whether or not the build watches:

("--watch" if watch),
("--watcher :watcher" if process_watcher),

--watcher names the backend ember build watches the file system with, so it has no effect on a build that does not watch. rake ember:compile and assets:precompile of an application configured with watcher — through the app option or EmberCli.configuration.watcher — carry the flag for nothing.

The change

Gate the flag on watch:

("--watcher :watcher" if watch && process_watcher),

and say in the classic builder's comment why it only rides along with --watch. A watching build is unchanged, and the existing examples for it already pass watch: true, so none of them needed editing.

Tests

  • bin/rspec spec/lib/ember_cli/command_spec.rb — 15 examples, 0 failures, including a new one asserting --watcher is omitted from a non-watching build
  • bin/rspec spec/lib — 2 failures, both (app_spec.rb:192, app_spec.rb:200) failing identically on main; they need node_modules installed to find the ember binary

🤖 Generated with Claude Code

@tricknotes
tricknotes marked this pull request as ready for review September 11, 2026 16:46
@tricknotes
tricknotes force-pushed the pass-watcher-only-when-watching branch 2 times, most recently from 465b36f to b662544 Compare September 11, 2026 17:25
`Command#ember_build` puts `--watcher` on the command line whenever a
watcher is configured, whether or not the build watches. The flag names the
backend `ember build` watches the file system with, so it has no effect on
a build that does not watch: `rake ember:compile` and `assets:precompile`
of an application configured with `watcher`, through the app option or
`EmberCli.configuration`, carried it for nothing.

Gate the flag on `watch`, and say in the classic builder's comment why it
only rides along with `--watch`. A watching build is unchanged, and the
existing examples for it already pass `watch: true`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tricknotes
tricknotes force-pushed the pass-watcher-only-when-watching branch from b662544 to 1d4bb7b Compare September 11, 2026 17:29
@tricknotes
tricknotes merged commit 9ea3acd into main Sep 11, 2026
16 checks passed
@tricknotes
tricknotes deleted the pass-watcher-only-when-watching branch September 11, 2026 17:30
@tricknotes tricknotes mentioned this pull request Sep 11, 2026
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

Successfully merging this pull request may close these issues.

2 participants