forked from dalphyx/vue-top-progress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
46 lines (45 loc) · 948 Bytes
/
build.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
const rollup = require('rollup')
const babel = require('rollup-plugin-babel')
const vue = require('rollup-plugin-vue')
const uglify = require('rollup-plugin-uglify')
const pkg = require('./package.json')
rollup.rollup({
input: './src/index.js',
plugins: [
vue({
compileTemplate: true
}),
babel({
babelrc: false,
exclude: 'node_modules/**',
presets: [
[
"@babel/preset-env",
{
"modules": false,
"loose": true,
"targets": {
"browsers": [
"last 2 versions",
"ie >= 9"
]
}
}
],
[
"@babel/preset-stage-2",
{
"decoratorsLegacy": true
}
]
]
}),
uglify()
]
}).then(bundle => {
bundle.write({
format: 'umd',
name: 'vueTopProgress',
file: `./dist/${pkg.name}.min.js`
})
})