-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
55 lines (54 loc) · 1.54 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
53
54
55
import { babel, getBabelOutputPlugin } from '@rollup/plugin-babel'
// import buble from '@rollup/plugin-buble'
import json from '@rollup/plugin-json'
import terser from '@rollup/plugin-terser'
// import commonjs from '@rollup/plugin-commonjs'
export default {
input: 'src/index.mjs',
// output: {
// dir: 'output',
// // format: 'es'
// // format: 'iife'
// format: 'cjs'
// },
external: [/@babel\/runtime/],
output: [
{
file: 'dist/index.cjs.js',
format: 'cjs',
// external: [/@babel\/runtime/],
plugins: [
getBabelOutputPlugin({
// presets: ['@babel/preset-env'],//, '@babel/plugin-transform-spread']
presets: ['@babel/preset-env'], //, '@babel/plugin-transform-runtime'],
// WORKS! But not ideal for AJ since its so old
// plugins: [['@babel/plugin-transform-runtime']],
})
]
},
{
file: 'dist/index.es.js',
// external: [/@babel\/runtime/],
format: 'es',
// plugins: [
// getBabelOutputPlugin({
// presets: ['@babel/preset-env'],//, '@babel/plugin-transform-spread']
// })
// ]
}
],
plugins: [
// commonjs(),
json(),
babel({ babelHelpers: 'bundled' }),
terser(),
// WORKS! But not ideal for AJ since its so old
// babel({ babelHelpers: 'runtime', plugins: [['@babel/plugin-transform-runtime']] }),
// buble(),
]
// plugins: [
// getBabelOutputPlugin({
// presets: ['@babel/preset-env'],//, '@babel/plugin-transform-spread']
// })
// ]
}