-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.client-watch.js
43 lines (36 loc) · 1.14 KB
/
webpack.client-watch.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
var webpack = require("webpack");
var config = require("./webpack.client.js");
config.cache = true;
config.debug = true;
config.devtool = "eval";
config.entry.unshift(
"webpack-dev-server/client?http://localhost:8080",
"webpack/hot/only-dev-server"
);
config.output.publicPath = "http://localhost:8080/dist/";
config.output.hotUpdateMainFilename = "update/[hash]/update.json";
config.output.hotUpdateChunkFilename = "update/[hash]/[id].update.js";
config.plugins = [
new webpack.DefinePlugin({__CLIENT__: true, __SERVER__: false}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
];
config.module = {
loaders: [
{include: /\.json$/, loaders: ["json-loader"]},
{include: /\.(js|jsx)$/, loaders: ["react-hot", "babel-loader?stage=0&optional=runtime&plugins=typecheck"], exclude: /node_modules/}
]
};
config.devServer = {
publicPath: "http://localhost:8080/dist/",
contentBase: "./static",
hot: true,
inline: true,
lazy: false,
quiet: true,
noInfo: false,
headers: {"Access-Control-Allow-Origin": "*"},
stats: {colors: true},
host: "0.0.0.0"
};
module.exports = config;