How to use the webpack-dev-server/client/web_modules/socket.io.connect function in webpack-dev-server

To help you get started, we’ve selected a few webpack-dev-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github markmarijnissen / angular-webpack-seed / src / dev-server.js View on Github external
var io = require("webpack-dev-server/client/web_modules/socket.io");
io = io.connect('http://'+DEV_SERVER_IP+':8080');

var initial = true;
var currentHash = "";

if(module.hot){
  console.log("[WDS] Hot Module Replacement enabled.");
}

io.on("invalid", function() {
  console.log("[WDS] App updated. Recompiling...");
});

io.on("hash", function(hash) {
  currentHash = hash;
});