-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathwebpack.config.js
50 lines (41 loc) · 1.08 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
48
49
50
var path = require("path");
var webpack = require("webpack");
var NODE_ENV = (process.env.NODE_ENV || '').trim().toLowerCase();
module.exports = {
debug: NODE_ENV != "production",
devtool: NODE_ENV != "production" ? "eval-source-map" : undefined,
entry: ["./js/main.js"],
module: {
loaders: [{
test: require.resolve("jquery"),
loader: "expose?$!expose?jQuery"
}, {
test: require.resolve("underscore"),
loader: "expose?_"
}, {
test: require.resolve("backbone"),
loader: "expose?Backbone"
}, {
test: require.resolve("backgrid"),
loader: "expose?Backgrid"
}, {
test: require.resolve("moment"),
loader: "expose?moment"
}]
},
output: {
path: path.join(__dirname, "build"),
filename: "bundle.js",
publicPath: "/build/",
pathinfo: NODE_ENV != "production"
},
plugins: NODE_ENV == "production" ? [
new webpack.DefinePlugin({
"process.env": {
"NODE_ENV": NODE_ENV
}
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin(),
] : []
}