I was trying to get this setup to work for a while and there is no support or similar issues over the web. There is actually one closed topic on Local community but no solution at all.
So, my setup is:
- Local by Flywheel server for WordPress
- VS Code with Node installed
- @wordpress/scripts to bundle all my CSS and JS files
- browser-sync to live reload
Here is my .json file:
{
"name": "mywebsite",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"live": "npm-run-all --parallel sync start",
"sync": "browser-sync start -p 'mywebsite.local' --files '**/*.php' 'build/*.js' 'build/*.css'",
"build": "wp-scripts build",
"start": "wp-scripts start",
"dev": "wp-scripts start",
"devFast": "wp-scripts start",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@wordpress/scripts": "*",
"browser-sync": "^2.27.9",
"node-sass": "^7.0.1",
"normalize.css": "^8.0.1",
"npm-run-all": "^4.1.5"
}
}
So, the Browser Sync starts nicely in the command line, when starting it opens a new browser windows with this Error below. There is nothing in the Local's log as they advice on this error screen.
Do anyone encounters similar problems and have the knowledge how to fix that? I would be super grateful for any hints, walkarounds or solutions or maybe someone can share the other simple setup ideas to achieve the live reload functionality?
