3

I would like to use both BrowserSync features and Rails/Webpacker (with Vue and Rails 5.1). My setup is working for Javascript from webpack-dev-server.

The SCSS/CSS is compiling correctly and writing to disk. Browser Sync reloads on HTML file changes.

How would I go about getting this working?

Rails: 3000 Browsersync: 3001 Webpack: 3035

browsersync.js

var BrowserSyncPlugin = require('browser-sync-webpack-plugin');

module.exports = {
  plugins: [
    new BrowserSyncPlugin(
      // BrowserSync options
      {
        // browse to http://localhost:3000/ during development
        host: 'localhost',
        port: 3001,
        files: ['public/packs/*.css', 'app/views/**/*', 'app/controllers/**/*'],
        // proxy the Webpack Dev Server endpoint
        // (which should be serving on http://localhost:3100/)
        // through BrowserSync
        proxy: 'http://localhost:3000/'
      },
      // plugin options
      {
        // prevent BrowserSync from reloading the page
        // and let Webpack Dev Server take care of this
        reload: false
      }
    )
  ]
}

.

0 Answers0