-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
48 lines (47 loc) · 954 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
/* eslint-disable import/no-extraneous-dependencies */
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: path.resolve(__dirname, './src/index.js'),
output: {
filename: './dist/vchart.min.js',
library: 'vchart',
libraryTarget: 'umd'
},
resolve: {
alias: {
vue: 'vue/dist/vue.common.js'
}
},
externals: {
chartist: {
commonjs: 'chartist',
commonjs2: 'chartist',
amd: 'Chartist',
root: 'Chartist'
}
},
module: {
rules: [{
test: /\.js$/,
use: 'babel-loader',
include: [path.resolve(__dirname, './src')]
}, {
test: /\.vue$/,
loader: 'vue-loader'
}]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
warnings: false
}
}),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
})
]
};