Fix webpack dev server watch behavior and port conflicts#3026
Fix webpack dev server watch behavior and port conflicts#3026
Conversation
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Mar 17, 2026 2:19p.m. | Review ↗ | |
| JavaScript | Mar 17, 2026 2:19p.m. | Review ↗ |
📝 WalkthroughWalkthroughThe webpack development configuration was updated to rename an environment variable from SITE_URL to SITE_DOMAIN, change dev server ports from 3000/3001 to 8880/8881, add third-party directory exclusions to watch options, and introduce conditional file watching handlers for JS and PHP files triggered by ENABLE_WATCH. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@webpack.dev.js`:
- Around line 93-109: The compiled-output watcher (config.jsPath) is matching
source JS files and causing browserSyncInstance.reload() to run before webpack
finishes; update the watcher for config.jsPath to exclude source directories
(the same paths used by config.jsSrcPath) — either by changing the glob to
exclude js/src/** or by adding an ignore/negation pattern so the match for
config.jsPath only targets compiled bundles, ensuring only the jsSrcPath watcher
logs "JS source updated" while the compiled watcher triggers reload after build
completion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 790a2da0-442a-4a0d-8ace-f4227e833e25
📒 Files selected for processing (1)
webpack.dev.js
| browserSyncInstance.reload(); | ||
| } | ||
| }, | ||
| { |
There was a problem hiding this comment.
@shervElmi Is there any reason for watching PHP file changes?
I don't really see how a PHP change would ever impact the built files.
There was a problem hiding this comment.
@Crabcyborg when you're working on a new feature that involves a new design, it really makes sense and speeds things up a lot. You don’t need to manually refresh the browser, so you can just focus on the design and codebase while the browser refreshes automatically, whether it's PHP, JS, or SCSS/CSS changes.
Actually, wp-scripts already has this feature: https://www.npmjs.com/package/@wordpress/scripts#usage-1
Here’s how I use it so I can stay focused on the codebase without refreshing the browser:
This PR fixes issues in the Formidable development server setup.
Testing
npm run servenode_modulesorvendorSummary by CodeRabbit