This repository was archived by the owner on Jul 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathwebpack.config.js
More file actions
44 lines (42 loc) · 1.48 KB
/
webpack.config.js
File metadata and controls
44 lines (42 loc) · 1.48 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
// Copyright (C) 2012-present, The Authors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
var path = require("path");
var webpack = require("webpack");
module.exports = {
// devtool: "source-map",
entry: ["./src/index"],
output: {
path: path.join(__dirname, "dist"),
filename: "admin_bundle.js",
publicPath: "/dist/"
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
}
}),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
],
resolve: {
extentions: [ '', '.js', '.css', '.png', '.svg' ]
},
module: {
preLoaders: [{ test: /\.json$/, loader: "json" }],
loaders: [
{
test: /\.js$/,
loaders: ["babel"],
include: path.join(__dirname, "src")
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: "file-loader"
}
]
}
};