-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebpack.config.js
40 lines (38 loc) · 935 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
const CopyWebpackPlugin = require('copy-webpack-plugin');
const merge = require('webpack-merge');
const path = require('path');
var config = {
mode: 'production',
output: {
path: path.resolve(__dirname + '/dist/')
},
module: {
rules: [
{
test: /\.js$/,
include: path.resolve(__dirname + '/src'),
exclude: /node_modules/,
use: 'babel-loader',
}
]
},
plugins: [
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, 'src/AnimatedNumber.vue'),
to: path.resolve(__dirname, 'dist/'),
ignore: ['.*']
}
])
]
};
module.exports = [
merge(config, {
entry: path.resolve(__dirname, 'src/polyfills/animation-frame-polyfill.js'),
output: {
filename: 'polyfills/animation-frame-polyfill.js',
libraryTarget: 'umd',
library: '@gaomd/mpvue-animated-number/polyfills/animation-frame-polyfill',
}
})
];