-
Notifications
You must be signed in to change notification settings - Fork 17
/
webpack.config.js
52 lines (49 loc) · 1.16 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
52
var webpack = require('webpack');
var webpackNodeExternals = require('webpack-node-externals');
var path = require('path');
var version = require('./package.json').version;
var banner = "chartjs-plugin-draggable.js\n" +
"http://chartjs.org/\n" +
"Version: " + version + "\n\n" +
"Copyright 2016 Jonathon Hill\n" +
"Released under the MIT license\n" +
"https://github.com/compwright/chartjs-plugin-draggable/blob/master/LICENSE.md";
module.exports = {
entry: {
'chartjs-plugin-draggable': './src/index.js',
'chartjs-plugin-draggable.min': './src/index.js'
},
output: {
path: './dist',
filename: '[name].js'
},
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
externals: {
'chart.js': 'Chart'
},
module: {
loaders: [
{
// compile down from ES5
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
},
plugins: [
new webpack.BannerPlugin(banner),
new webpack.ProvidePlugin({
Chart: 'chart.js'
}),
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true,
compress: {
warnings: false
}
})
]
};