-
Notifications
You must be signed in to change notification settings - Fork 4
/
rollup.config.js
46 lines (42 loc) · 990 Bytes
/
rollup.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
import { nodeResolve } from '@rollup/plugin-node-resolve'
import { terser as uglify } from 'rollup-plugin-terser'
import typescript from '@rollup/plugin-typescript'
import commonjs from '@rollup/plugin-commonjs'
import { babel } from '@rollup/plugin-babel'
import banner2 from 'rollup-plugin-banner2'
import pkg from './package.json'
const ResolveBanner = () => {
return `/**
* name: ${pkg.name}
* version: v${pkg.version}
* author: ${pkg.author}
* (c) ${new Date().getFullYear()} - Released under the MIT License.
*/`;
}
export default {
input: 'src/index.ts',
output: [
{
name: pkg.name,
format: 'umd',
file: `./dist/${pkg.name}.umd.js`
},
{
name: pkg.name,
format: 'umd',
file: `./dist/${pkg.name}.umd.min.js`,
plugins: [uglify()]
}
],
plugins: [
babel({
babelHelpers: 'bundled'
}),
nodeResolve({
browser: true
}),
commonjs(),
typescript(),
banner2(ResolveBanner)
]
}