-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.js
51 lines (48 loc) · 1.2 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
import { getBabelOutputPlugin } from '@rollup/plugin-babel'
import path from 'path'
import pkg from './package.json'
function isExternal (candidate) {
return Object.keys(pkg.dependencies).some(dependency => {
return candidate.startsWith(dependency)
})
}
export default [
{
input: path.resolve(__dirname, 'src', 'index.js'),
external: isExternal,
output: [
{
file: pkg.main,
format: 'cjs',
sourcemap: true
},
{
file: pkg.module,
format: 'es',
sourcemap: true
}
],
plugins: [
getBabelOutputPlugin({
presets: [
['@babel/preset-env',
// {
// debug: true,
// useBuiltIns: 'usage',
// shippedProposals: true,
// targets: {
// node: '8.10',
// edge: '17',
// firefox: '60',
// chrome: '67',
// safari: '11.1'
// },
// corejs: 3
// }
]
],
plugins: ['@babel/plugin-transform-runtime', '@babel/plugin-proposal-object-rest-spread', '@babel/plugin-proposal-class-properties']
})
]
}
]