forked from philipjkim/vue2-flip-countdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
44 lines (41 loc) · 948 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
// config for webpack v3
const webpack = require('webpack')
const path = require('path')
const PROD = process.env.NODE_ENV === 'production'
module.exports = {
entry: path.join(__dirname, '/src/FlipCountdown.vue'),
output: {
path: path.join(__dirname, '/dist/'),
filename: 'vue2-flip-countdown.js',
libraryTarget: 'umd',
library: 'vue2-flip-countdown',
umdNamedDefine: true
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
js: {
loader: 'babel-loader',
options: { presets: ['env'] }
},
less: 'vue-style-loader!css-loader!less-loader'
}
}
}
]
},
plugins: PROD ? [
new webpack.optimize.UglifyJsPlugin({
minimize: !!PROD,
sourceMap: !PROD,
mangle: !!PROD,
compress: {
warnings: !PROD
}
})
] : []
}