Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/mix browsersync #72

Merged
merged 2 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "WordPress starter theme with a modern development stack for launching projects faster and easily",
"engines": {
"node": ">=18.0.0 <19",
"npm": ">=9 <10"
"npm": ">=9 <11"
},
"dependencies": {
"@wordpress/babel-preset-default": "7.28.0",
Expand Down
42 changes: 22 additions & 20 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,26 +125,28 @@ allAssets.forEach(assetPath => {
/**
* BrowserSync runs on dev mode only
*/
mix.browserSync({
/**
* Proxying to nginx container with alias APP_DOMAIN
* Proxy should be the same as WP_SITEURL in wp-config.php
*/
proxy: getAppUrl(),
/**
* Set external host network IP.
* If hostIp is undefined, just find your local network IP in your system
* and use it in your other devices browser to sync with BrowserSync.
*/
host: getHostIp(),
port: 3000,
open: false,
files: [
'**/*.php',
'**/*.twig',
'**/src/**/*.@(scss|js|jsx)',
],
});
if (!mix.inProduction()) {
mix.browserSync({
/**
* Proxying to nginx container with alias APP_DOMAIN
* Proxy should be the same as WP_SITEURL in wp-config.php
*/
proxy: getAppUrl(),
/**
* Set external host network IP.
* If hostIp is undefined, just find your local network IP in your system
* and use it in your other devices browser to sync with BrowserSync.
*/
host: getHostIp(),
port: 3000,
open: false,
files: [
'**/*.php',
'**/*.twig',
'**/src/**/*.@(scss|js|jsx)',
],
});
}

function getAppUrl() {
const appProtocol = process.env.APP_PROTOCOL;
Expand Down