forked from openwisp/netjsongraph.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.prod.js
53 lines (52 loc) · 1.06 KB
/
webpack.config.prod.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
51
52
53
const webpack = require('webpack');
const path = require('path');
const SRC = path.join(__dirname, 'src');
const DIST = path.join(__dirname, 'dist');
module.exports = {
entry: {
js: path.join(SRC, 'netjsongraph.js')
},
output: {
path: DIST,
filename: 'netjsongraph.min.js'
},
module: {
loaders: [{
test: /\.html$/,
loader: 'file?name=[name].[ext]'
}, {
test: /\.js$/,
exclude: /node_modules/,
loaders: [
'babel-loader'
]
}, {
test: /\.css$/,
loaders: [
'style-loader',
'css-loader?importLoaders=1',
'postcss-loader'
]
}, {
test: /\.json/,
loader: 'json-loader'
}, {
test: /\.(png|jpg|svg)$/,
loader: 'url?limit=80000'
}]
},
resolve: {
extensions: ['', '.js']
},
postcss: function () {
return [
require('precss'),
require('autoprefixer')
];
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.AggressiveMergingPlugin()
]
};