-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathwebpack.config.js
54 lines (51 loc) · 1.17 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
53
54
// config for webpack v3
const webpack = require('webpack')
const path = require('path')
const TerserPlugin = require("terser-webpack-plugin")
const { VueLoaderPlugin } = require('vue-loader');
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'
}
}
},
{
test: /\.less$/i,
use: [
// compiles Less to CSS
"vue-style-loader",
"css-loader",
"less-loader",
],
},
]
},
optimization: PROD ? {
minimize: true,
minimizer: [new TerserPlugin()],
} : {
minimize: false
},
plugins: [
new VueLoaderPlugin()
]
}