-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
49 lines (48 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
var webpack = require('webpack');
var minimize = process.argv.indexOf('--no-minimize') === -1 ? true : false;
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
var plugins = minimize ? [
new webpack.optimize.UglifyJsPlugin({
minimize: true,
compress: {
drop_console: true
},
}),
new webpack.optimize.MinChunkSizePlugin({minChunkSize: '100000'}),
new BundleAnalyzerPlugin( {
analyzerMode: 'static',
analyzerPort: 4000,
openAnalyzer: false
}
)
] : [
new webpack.optimize.MinChunkSizePlugin({minChunkSize: '100000'})
];
module.exports = {
node: {
console: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty'
},
entry: {
'dist/easygooglemaps':'./src/easygooglemaps.js'
},
output: {
path: './',
filename: minimize ? '[name].min.js' : '[name].js',
libraryTarget: 'umd',
library: 'EasyGoogleMaps'
},
module: {
loaders: [{
test: /\.js?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel'
},{
test: /\.json$/,
loader: 'json'
}]
},
plugins: plugins
};