ainsley_clark's avatar

Browser Sync with Webpack Mix

Hi there,

Im trying to get hot reload to work within Laravel Mix and a the serve command:

php -S localhost:8000

I run above which gets me the php files (note I'm not using Laravel). But with Browsersync, whatever I try it wont reload the page:

// mix.browserSync({
//     proxy:"localhost:8000",
//     baseDir: "./public/",
//     open: true,
//     notify: false
// });

mix.webpackConfig({
    plugins: [
        new BrowserSyncPlugin({
            host: 'localhost',
            port: 8000,
            server: { baseDir: ['public'] },
            files: [
                '**/*.css'
            ]
        })
    ]
})

I have all of my public files in public and wepack.mix.js is in the root.

Any ideas?

Thanks in advance.

0 likes
3 replies
ainsley_clark's avatar

Thanks for your reply.

I have tried that but was unable to get hot reloading to work.

Please or to participate in this conversation.