Search code examples
wordpressbrowsergulpsynchronizationwatch

Gulp watch browser sync reloading browser only for php files


I have problem with gulpfile.js. My wordpress folders:

Folder structure

My gulpfile variable:

var browserSyncWatchFiles = [
    './**/*.php',
    './**/*.css',
    './**/*.scss'
];

Gulp is reloading browser only when I change anything in *.php files even in subfolders. When I change scss file or css it is not reloading. How can I solve this?


Solution

  • browserSync is not supposed to do a full page reload when you make changes to styles or images. Instead it updates only the specific assets, it's called SASS+CSS injecting.

    If you want to enable full page reload even with styles and images, you need to set injectChanges: false in browserSync options.