-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
51 lines (47 loc) · 1015 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const webpack = require('webpack')
const webpackNodeExternals = require('webpack-node-externals')
const path = require('path')
const version = require('./package.json').version
const config = {
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
externals: {
'chart.js': 'Chart'
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015'],
}
}]
},
plugins: [
new webpack.ProvidePlugin({
Chart: 'chart.js'
}),
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true,
compress: {
warnings: false
}
})
]
}
const dist = Object.assign({}, config, {
entry: {
'chartjs-plugin-timeline': './src/index.js',
'chartjs-plugin-timeline.min': './src/index.js'
},
output: {
path: './dist',
filename: '[name].js'
}
})
module.exports = [
dist
]