-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwebpack.config.demo.js
43 lines (41 loc) · 970 Bytes
/
webpack.config.demo.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
"use strict";
var webpack = require("webpack");
var path = require("path");
module.exports = {
entry: path.join(__dirname, "demo/app.jsx"),
output: {
path: path.join(__dirname, "demo"),
filename: "app.min.js"
},
resolve: {
extensions: ["", ".js", ".jsx"]
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: [/node_modules/],
loader: "babel"
}, {
test: /\.css$/,
loader: "style!css"
}, {
test: /\.(png|jpg)$/,
loader: "url?limit=8192"
}
]
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.DefinePlugin({
// Signal production, so that webpack removes non-production code that
// is in condtionals like: `if (process.env.NODE_ENV === "production")`
"process.env.NODE_ENV": JSON.stringify("production")
})
]
};