-
Notifications
You must be signed in to change notification settings - Fork 10
/
rollup.config.js
52 lines (49 loc) · 1.24 KB
/
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
47
48
49
50
51
52
import pkg from './package.json'
// import minify from 'rollup-plugin-babel-minify'
import { uglify } from 'rollup-plugin-uglify'
import buble from '@rollup/plugin-buble'
import json from '@rollup/plugin-json'
import dop from './src/index'
export default [
// dop.js
{
input: 'src/index',
external: ['ms'],
output: [
// { file: pkg.module, format: 'es' }
{
file: pkg.main,
format: 'cjs',
exports: 'named',
},
],
plugins: [json(), buble()],
},
// dop.umd.js
{
input: 'src/index',
output: {
name: 'dop',
file: pkg.browser,
format: 'umd',
exports: 'named',
},
plugins: [
json(),
buble(),
uglify({
mangle: {
reserved: Object.keys(dop.TYPE),
},
}),
],
},
// // dop.module.js
// {
// input: 'src/index',
// external: ['ms'],
// // preserveModules: true,
// output: [{ dir: './module', format: 'es' }],
// plugins: [json()],
// },
]