diff --git a/app/script/mqtt.ts b/app/script/mqtt.ts index 5fe6189..ff7fa75 100644 --- a/app/script/mqtt.ts +++ b/app/script/mqtt.ts @@ -1,5 +1,5 @@ -import "paho-mqtt/mqttws31"; /// +import "paho-mqtt/mqttws31"; import MQTT = Paho.MQTT; import { EventEmitter } from "events"; @@ -15,7 +15,7 @@ export class MqttApiClient extends EventEmitter implements SprinklersApi { constructor() { super(); - this.client = new Paho.MQTT.Client(location.hostname, 1884, MqttApiClient.newClientId()); + this.client = new MQTT.Client(location.hostname, 1884, MqttApiClient.newClientId()); this.client.onMessageArrived = m => this.onMessageArrived(m); this.client.onConnectionLost = e => this.onConnectionLost(e); } diff --git a/webpack.config.js b/webpack.config.js index a4b0b6a..691f4ec 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,9 +5,11 @@ const HtmlWebpackPlugin = require("html-webpack-plugin"); module.exports = { entry: [ "react-hot-loader/patch", + "webpack-dev-server/client?http://localhost:8080", + "webpack/hot/only-dev-server", "./app/script/index.tsx" ], - devtool: "sourcemap", + devtool: "inline-source-map", output: { path: path.resolve(__dirname, "dist"), filename: "bundle.js" @@ -32,12 +34,7 @@ module.exports = { new webpack.NamedModulesPlugin(), new webpack.HotModuleReplacementPlugin() ], - externals: { - "react": "React", - "react-dom": "ReactDOM" - }, devServer: { - hot: true, - contentBase: "./dist" + hot: true } }; \ No newline at end of file