Va1 / browser-sync-webpack-plugin

Easily use BrowserSync in your Webpack project.
MIT License
369 stars 40 forks source link

not always webpack.config.js #53

Closed brian-lamb-software-engineer closed 4 years ago

brian-lamb-software-engineer commented 6 years ago

Keep in mind, per your instructions on npm and here, it wont always be webpack.config.js in my case its webpack.mix.js. This threw me off, i started looking into if i needed to add the config, or override it, and where it might reside, all along i finally realized it was where i was initiating it in my webpack.mix.js

 mix.webpackConfig({
    plugins: [
        new BrowserSyncPlugin({
            port: 3009,
            files: [
                'app/**/*',
                 'public/**/*',
                'resources/views/**/*',
                'resources/assets/**/*',
                'routes/**/*'
            ]
        })
    ]
 }) ;

For some reason, i had to override the port, node is showing up several times in netstat, i use msys2 (xming or cygwin), thats how i came across this.

Thanks.

malinbranduse commented 6 years ago

@brian-lamb-software-engineer Hello! If you are using webpack.mix.js I'll throw a wild guess that you're using Laravel and laravel-mix, right? If so, it comes with Browsersync included; to configure it just call mix.browserSync(configObject); in your mix file. Where configObject complies with the standard Browsersync configuration.

Here's the official lavavel-mix documentation on this

malinbranduse commented 6 years ago

@brian-lamb-software-engineer If it works, please go ahead and close this issue as it's not directly related to this package and because the repo owner (@Va1 ) has been mostly inactive the whole year. :grin:

Va1 commented 4 years ago

fair fair point @malinushj . gonna be closing this myself. thanks