-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
38 lines (35 loc) · 957 Bytes
/
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
"use strict";
let path = require("path"),
HtmlWebpackPlugin = require('html-webpack-plugin'),
webpack = require('webpack');
module.exports = {
entry: {
app: "./src/game-of-life.js",
vendor: ['react', 'react-dom']
},
output: {
path: path.join(__dirname, "dist"),
filename: "bundle.js"
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: ["babel"],
query: {
presets: ['es2015', 'react']
}
}, {
test: /\.css$/,
loader: "style-loader!css-loader"
}]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.bundle.js"),
new HtmlWebpackPlugin({
template: __dirname + '/src/index.html',
filename: 'index.html',
inject: 'body'
})
]
};