Skip to content

Commit 0e33758

Browse files
authored
feat(dart_frog_cli): development server custom entrypoint support (#270)
1 parent dbd0c68 commit 0e33758

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/dart_frog_cli/lib/src/commands/dev/dev.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,14 @@ class DevCommand extends DartFrogCommand {
170170
await serve();
171171
progress.complete('Running on http://localhost:$port');
172172

173+
final entrypoint = path.join(cwd.path, 'main.dart');
173174
final public = path.join(cwd.path, 'public');
174175
final routes = path.join(cwd.path, 'routes');
175176

176177
bool shouldReload(WatchEvent event) {
177178
logger.detail('[watcher] $event');
178-
return path.isWithin(routes, event.path) ||
179+
return path.equals(entrypoint, event.path) ||
180+
path.isWithin(routes, event.path) ||
179181
path.isWithin(public, event.path);
180182
}
181183

packages/dart_frog_cli/lib/src/commands/dev/templates/dart_frog_dev_server_bundle.dart

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)