-
Notifications
You must be signed in to change notification settings - Fork 829
/
Copy pathrollup.config.js
37 lines (35 loc) · 1000 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
import babel from '@rollup/plugin-babel'
// eslint-disable-next-line import/no-namespace
import * as octicons from '../octicons_react/dist/index.esm'
const icons = Object.keys(octicons).filter(name => name !== 'default')
export default [
{
input: 'src/__generated__/index.js',
plugins: [
babel({
babelrc: false,
presets: [[require.resolve('@babel/preset-env'), {modules: false}], require.resolve('@babel/preset-react')],
babelHelpers: 'inline'
})
],
output: {
file: 'dist/index.umd.js',
format: 'umd',
name: 'reocticons'
}
},
{
input: Object.fromEntries(icons.map(name => [`icons/${name}`, `src/__generated__/icons/${name}.js`])),
plugins: [
babel({
babelrc: false,
presets: [[require.resolve('@babel/preset-env'), {modules: false}], require.resolve('@babel/preset-react')],
babelHelpers: 'bundled'
})
],
output: {
dir: 'dist',
format: 'esm'
}
}
]