-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.hot.js
More file actions
42 lines (36 loc) · 917 Bytes
/
webpack.config.hot.js
File metadata and controls
42 lines (36 loc) · 917 Bytes
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
var config = require("./webpack.config");
var webpack = require("webpack");
/**
* Define global application variables.
*/
var definePlugin = new webpack.DefinePlugin({
__DEV__: JSON.stringify(JSON.parse(process.env.DEBUG || false)),
"process.env": {
NODE_ENV: JSON.stringify("development")
}
});
config.devtool = "source-map";
/**
* Change entry to use webpack-dev-server for hot reload.
*/
config.entry = [
"webpack-dev-server/client?http://127.0.0.1:3000",
"webpack/hot/only-dev-server",
"./src/scripts/main"
];
/**
* Use the local server for public path.
*/
config.output.publicPath = "http://127.0.0.1:3000/";
/**
* Add development specific plugins to the common ones.
*/
config.plugins = config.commonPlugins.concat([
definePlugin,
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
]);
/**
* Export the configuration object.
*/
module.exports = config;