Closed ottok closed 3 years ago
It seems browser-sync cannot run by default, but must be hooked to assets via gulp: https://seravo.com/docs/development/gulp/
Implement commands wp-browsersync-on and wp-browsersync-off so that browsersync can be disabled. See #39.
Extra feature:
When wp-browsersync-on
is run, it could check with wp option get siteurl
if the site has http or https, and automatically edit the gulpfile and /etc/nginx/sites-enabled/default to run with https so Browsersync can works with https.
For https support:
gulpfile.js
browserSync.init({
// browsersync with a php server
proxy: "https://localhost:8080",
https: {
key: "/data/wordpress/.vagrant/ssl/development.key",
cert: "/data/wordpress/.vagrant/ssl/development.crt"
},
/etc/nginx/sites-enabled/default
upstream: https://wordpress;
I managed to get browsersync working (UI not working) with https when using: gulpfile.js
browserSync.init({
// browsersync with a php server
proxy: "http://localhost:8080",
https: {
key: "/data/wordpress/.vagrant/ssl/development.key",
cert: "/data/wordpress/.vagrant/ssl/development.crt"
},
/etc/nginx/sites-enabled/default
upstream: https://wordpress;
Some notices I made:
If I add proxy: "https://localhost:8080"
to /data/wordpress/gulpfile.js, the whole site stops working over browsersync due to 502 error
When gulp watch is not running, the modification upstream: https://wordpress;
made to /etc/nginx/sites-available/ causes an 502 error when accessing either https://wordpress.local/ or http://wordpress.local/
Development in progress at https://github.com/Seravo/wp-palvelu-vagrant/tree/feature-wp-xdebug-commands. HTTPS support for Browsersync has not yet been implemented into the scripts due to the problems mentioned in the previous comment on this issue.
This should be fixed and tested in parallel with https://github.com/Seravo/wordpress/issues/140
Could not replicate Browsersync errors. The UI works fine as well. Closing for now, as the issue is quite old.
The error log is constantly filled with BrowserSync service errors. Viewing the BrowserSync page does not work either.