forked from cheton/infinite-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
30 lines (28 loc) · 856 Bytes
/
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
var path = require('path');
var webpack = require('webpack');
var pkg = require('./package.json');
var banner = pkg.name + ' v' + pkg.version + ' | (c) ' + new Date().getFullYear() + ' ' + pkg.author + ' | ' + pkg.license + ' | ' + pkg.homepage;
var env = process.env.BUILD_ENV;
var plugins = [
new webpack.BannerPlugin(banner)
];
if (env === 'dist') {
plugins = plugins.concat([
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
mangle: false
})
]);
}
module.exports = {
entry: path.resolve(__dirname, 'lib/index.js'),
output: {
path: path.join(__dirname, 'dist'),
filename: env === 'dist' ? 'infinite-tree.min.js' : 'infinite-tree.js',
libraryTarget: 'umd',
library: 'InfiniteTree'
},
plugins: plugins
};