-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
58 lines (57 loc) · 1.51 KB
/
webpack.config.js
File metadata and controls
58 lines (57 loc) · 1.51 KB
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
48
49
50
51
52
53
54
55
56
57
58
const ExtractTextPlugin = require("extract-text-webpack-plugin")
const HtmlWebpackPlugin = require("html-webpack-plugin")
const loadersConf = require("./webpack.loaders")
const path = require("path")
const webpack = require("webpack")
module.exports = {
node: {
fs: "empty",
net: "empty",
tls: "empty",
dns: "empty"
},
entry: [
"core-js/fn/promise",
"core-js/es6/object",
"core-js/es6/array",
"./src/index.jsx" // entry point
],
devtool: process.env.WEBPACK_DEVTOOL || "eval-source-map",
output: {
publicPath: "/",
path: path.join(__dirname, "public"),
filename: "bundle.js"
},
module: {
rules: loadersConf
},
resolve: {
extensions: [".js", ".jsx"],
modules: [
path.join(__dirname, "src"),
path.join(__dirname, "node_modules")
],
alias: {
styles: path.resolve(__dirname, "styles/")
}
},
devServer: {
contentBase: "./public"
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(),
new ExtractTextPlugin({
filename: "style.css",
allChunks: true
}),
new HtmlWebpackPlugin({
template: "./src/template.html",
files: {
css: ["style.css"],
js: ["bundle.js"]
}
})
]
};