-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
47 lines (43 loc) · 1.02 KB
/
webpack.config.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
44
45
46
47
const path = require("path"),
webpack = require("webpack");
var screw_ie8 = false; // Same name as uglify's IE8 option. Turn this on to enable HMR.
var plugins = [];
// HMR doesn't work with IE8
if(screw_ie8) {
plugins.push(new webpack.HotModuleReplacementPlugin());
}
module.exports = {
entry: "./src/index.js",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist"),
publicPath: "/dist/"
},
devServer: {
host: "0.0.0.0", // Use this rather than localhost so we can access from a VM for browser testing
contentBase: path.join(__dirname, "./"),
publicPath: "/dist/",
// HMR adds `Object.defineProperty` that breaks IE8
hot: screw_ie8,
inline: screw_ie8
},
plugins: plugins,
module: {
rules: [
{
test: /\.js$/,
include: [
path.resolve(__dirname, "src")
],
use: {
loader: "babel-loader"
}
},
{
test: /\.js$/,
enforce: "post",
loader: "es3ify-loader"
}
]
}
};