@dghez, I just tried a fresh composer install and ran the Sage installer with all the defaults. I also set the site to run under SSL (ie. https://sage9.dev). I set this same URL in the sage installer.
I’m using a different system for my server (Laravel Valet) so maybe your results will be a bit different but I observed similar problems with CSS not updating. Part of the problem seems to be that if you have a devUrl
under HTTPS, the browsersync proxyUrl
is still http by default in the config.
In my setup, all non-HTTPS traffic gets redirected automatically so when I ran yarn start
, it was loading https://localhost:3000/ in the browser but it wasn’t working because of mixed content (still trying to load content from http://localhost:3000/ due to the proxyUrl
setting). I also had lots of browser warnings because I don’t have a valid SSL certificate for localhost so I had to tell Chrome I wanted to proceed anyway…
When I changed the proxyUrl
to https://localhost:3000
, and ran yarn start
again, it finally began to work with the styles reloading (and viewing on https://localhost:3000 despite the broken HTTPS warnings).
For reference, this is my config.json
:
{
"entry": {
"main": [
"./scripts/main.js",
"./styles/main.scss"
],
"customizer": [
"./scripts/customizer.js"
]
},
"publicPath": "/wp-content/themes/sage9",
"devUrl": "https://sage9.dev",
"proxyUrl": "https://localhost:3000",
"cacheBusting": "[name]_[hash:8]",
"watch": [
"app/**/*.php",
"config/**/*.php",
"resources/views/**/*.php"
]
}
So in summary, it looks like there are some issues with using Browsersync and a HTTPS devUrl. Unless you really need HTTPS locally, I think it would be better to go without it.
What happens if you try to visit your dev URL with just http://? If it redirects, you might have to update your WordPress siteurl
and home
entries in the wp_options
table. If you can make it work without the HTTPS, you should have fewer headaches with all this…