Conversation
6 tasks
There was a problem hiding this comment.
Pull request overview
Adds BrowserSync-based live reload (CSS injection + full-page reload) to the theme’s development workflow, integrating it into the existing webpack-based asset pipeline and conditionally loading the BrowserSync client in local/dev WordPress environments.
Changes:
- Add
browser-sync+browser-sync-webpack-pluginand wire BrowserSync into the webpack “scripts” config. - Add an
npm run devscript to run webpack in watch mode with the multi-config setup. - Conditionally enqueue the BrowserSync client script in PHP for
local/developmentenvironments.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| webpack.config.js | Adds BrowserSyncWebpackPlugin to enable reload/inject behavior during webpack watch builds. |
| package.json | Adds BrowserSync deps and a new dev watch script for the enhanced dev loop. |
| package-lock.json | Locks newly added BrowserSync-related dependencies. |
| inc/classes/class-assets.php | Enqueues the BrowserSync client on local/development to enable snippet-mode reloads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
abhishekxix
reviewed
May 6, 2026
| wp_enqueue_style( 'elementary-theme-styles' ); | ||
|
|
||
| if ( 'local' === wp_get_environment_type() && ! is_ssl() ) { | ||
| wp_enqueue_script( 'browser-sync', 'http://localhost:3000/browser-sync/browser-sync-client.js', [], false, true ); |
Member
There was a problem hiding this comment.
Also, can we make the port number configurable in some way?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds live reload and CSS hot-reloading to the dev workflow via BrowserSync. Running
npm run devnow watches for file changes. CSS updates inject in-place without a full reload; PHP, HTML, and JS changes trigger a full page reload.Technical Details
Implementation: BrowserSync snippet mode
instances on the same port).
https://localhost:3000. Requires define('WP_ENVIRONMENT_TYPE', 'local') in wp-config.php.
Known limitation: Manually adding SSL certs
To make this work without opening the site on a different port(3000, in proxy mode), SSL cert paths will have to be added in .env.local (see .env.local.example)
Checklist
Fixes/Covers issue
Fixes #643