-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
45 lines (44 loc) · 894 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
39
40
41
42
43
44
45
import { DEFAULT_EXTENSIONS } from '@babel/core'
import typescript from 'rollup-plugin-typescript2'
import { babel } from '@rollup/plugin-babel'
export default [
{
input: './src/index.ts',
output: {
name: 'Colorfuls',
format: 'umd',
file: 'lib/index.js'
// exports: 'named'
},
plugins: [
typescript({}),
babel({
extensions: [...DEFAULT_EXTENSIONS, '.ts', '.tsx'],
babelHelpers: 'bundled'
})
]
},
{
input: './src/index.ts',
output: {
format: 'cjs',
file: 'lib/index.cjs.js',
exports: 'default'
},
plugins: [typescript({})]
},
{
input: './src/index.ts',
output: {
format: 'esm',
file: 'lib/index.esm.js'
},
plugins: [
typescript({
tsconfigOverride: {
compilerOptions: { declaration: true }
}
})
]
}
]