-
Notifications
You must be signed in to change notification settings - Fork 9
/
webpack.config.js
51 lines (44 loc) · 1.04 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
51
'use strict';
// http://webpack.github.io/docs/
const webpack = require('webpack');
// https://webpack.js.org/plugins/uglifyjs-webpack-plugin/
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const pkg = require('./package.json');
const ENTRY_POINT = './src/RecursiveIterator.js';
const LIBRARY_NAME = 'RecursiveIterator';
module.exports = {
entry: {
[pkg.name]: ENTRY_POINT,
[pkg.name + '.min']: ENTRY_POINT
},
module: {
loaders: [
// https://github.com/babel/babel-loader
{
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['es2016']
}
}
]
},
devtool: "source-map",
output: {
path: './dist',
libraryTarget: 'umd',
library: LIBRARY_NAME,
filename: "[name].js"
},
plugins: [
new UglifyJSPlugin({
// Minify only [name].min.js file
// http://stackoverflow.com/a/34018909
// include: /\.min\.js$/
}),
new webpack.BannerPlugin(
`${pkg.name} v${pkg.version}\n` +
`${pkg.homepage}`
)
]
};