diogosalazar / vue-cli-plugin-browser-sync

A Vue Cli 3 plugin for BrowserSync with no required configuration
MIT License
5 stars 3 forks source link

on @vue/cli 4 seems not work. #4

Open ghost opened 5 years ago

ghost commented 5 years ago
ncaught Error: [HMR] Hot Module Replacement is disabled.
    at Object.eval (webpack:///(:8080/webpack)-hot-middleware/process-update.js?:10:9)
    at eval (webpack:///(:8080/webpack)-hot-middleware/process-update.js?:159:30)
    at Object../node_modules/webpack-hot-middleware/process-update.js (chunk-vendors.js:1523)
    at __webpack_require__ (app.js:80)
    at Object.eval (webpack:///(:8080/webpack)-hot-middleware/client.js?:233:21)
    at eval (webpack:///(:8080/webpack)-hot-middleware/client.js?:308:30)
    at Object../node_modules/webpack-hot-middleware/client.js?noInfo=true&quiet=true&reload=true&name= (chunk-vendors.js:1512)
    at __webpack_require__ (app.js:80)
    at eval (client:1)
    at Object.0 (app.js:1146)

npm run serve - ok npm run serve:bs - no

kvakazyambra commented 5 years ago

It seems like this project was abandoned. And this commit has break BrowserSync and using webpack-hot-middleware at all.

kvakazyambra commented 5 years ago

Finally I found a way. In the vue.config.js you should place plugins: [ new webpack.HotModuleReplacementPlugin(), ]

rvanbaalen commented 4 years ago

@kvakazyambra Invalid options in vue.config.js: "plugins" is not allowed

rvanbaalen commented 4 years ago

@Tierey Have you found a solution?

kvakazyambra commented 4 years ago

Invalid options in vue.config.js: "plugins" is not allowed

@rvanbaalen Do you use this option properly?

module.exports = {
  configureWebpack: (config) => {
    return {
      plugins: [
          new webpack.HotModuleReplacementPlugin()
      ]
    }
  }
}

BTW, it works with vue 2.x, not testet with vue 3.

rvanbaalen commented 4 years ago

@kvakazyambra Yes, that worked! Your first comment stated 'add plugins to ...' so that didn't work. This one was very helpful :-)