forked from primer/octicons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
38 lines (36 loc) · 898 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
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
// 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: [['env', {modules: false}], 'stage-0', 'react']
}),
commonjs()
],
output: {
file: 'dist/index.umd.js',
format: 'umd',
name: 'reocticons'
}
},
...icons.map(name => ({
input: `src/__generated__/icons/${name}.js`,
plugins: [
babel({
babelrc: false,
presets: [['env', {modules: false}], 'stage-0', 'react']
}),
commonjs()
],
output: {
file: `dist/icons/${name}.js`,
format: 'esm'
}
}))
]