Fixed react hot reload plus a few other things
This commit is contained in:
parent
2000e0126c
commit
9cc2824298
@ -1,5 +1,5 @@
|
||||
import "paho-mqtt/mqttws31";
|
||||
/// <reference path="./paho-mqtt.d.ts" />
|
||||
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);
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user