-
Notifications
You must be signed in to change notification settings - Fork 9
/
webpack.production.config.js
47 lines (44 loc) · 1.17 KB
/
webpack.production.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
var path = require("path");
var node_modules_dir = path.resolve(__dirname, "node_modules");
var babelSettings = {
presets: ["es2015", "react"],
plugins: ["transform-object-rest-spread"]
};
var webpack = require("webpack");
var config = {
devtool: "cheap-source-map",
entry: {
app: path.resolve(__dirname, "client/index.js")
},
output: {
path: path.resolve(__dirname, "public"),
filename: "bundle.js"
},
module: {
loaders: [
{
test: /\.js$/,
// There is not need to run the loader through
// vendors
exclude: [node_modules_dir],
include: path.join(__dirname, "client"),
loaders: ["babel-loader?" + JSON.stringify(babelSettings)]
},
{
test: /\.css$/,
loader: "style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]"
}
]
},
plugins: [
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
}
})
//new webpack.optimize.DedupePlugin(),
//new webpack.optimize.OccurrenceOrderPlugin(),
//new webpack.optimize.UglifyJsPlugin({minimize: true}),
]
};
module.exports = config;