admin管理员组

文章数量:1124558

I've been trying to set up BrowserSync for my WordPress theme running locally with Local by Flywheel. Basically I followed this guide:

However, the page will hot reload only when changes in my CSS and JS files are being made - changes in my PHP files don't trigger anything. Even after hard refreshing the page myself, the changes still won't reflect in the proxy URL BrowserSync creates. They will appear in the Local URL fine though.

From what I have read, it seems like this could be because BrowserSync needs body tags for the script it inserts but the PHP files are all split up.

That blog post doesn't mention anything though so I'm at a loss. I've tried specifying the files in the mix.browserSync options parameter in the different ways below, but I get the same result. I'd be grateful if anyone could share what might be going wrong.

mix.browserSync({
  proxy: `http://<my-site>.local`,
  files: [
    `**/*`,
    `**/*.php`,
    `example-file.php`,
    `assets/js/main.min.js`,
    `assets/css/main.min.css`,
  ]
});

本文标签: BrowserSync not detecting PHP files in WordPressLaravel Mix