Skip to content

Commit

Permalink
Merge pull request #72 from solidbunch/update/mix-browsersync
Browse files Browse the repository at this point in the history
Update/mix browsersync
  • Loading branch information
yuriipavlov authored Dec 20, 2023
2 parents 1d44ef7 + b894103 commit ac970ab
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
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

0 comments on commit ac970ab

Please sign in to comment.