-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathrollup.config.ts
62 lines (59 loc) · 1.27 KB
/
rollup.config.ts
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
56
57
58
59
60
61
62
import pluginTs from '@rollup/plugin-typescript'
import { RollupOptions } from 'rollup'
import dts from 'rollup-plugin-dts'
const input = 'src/index.ts'
const external = ['react', 'react-dom', 'react/jsx-runtime']
const globals = {
react: 'React',
'react-dom': 'ReactDOM',
'react/jsx-runtime': 'jsxRuntime',
}
const config: RollupOptions[] = [
{
input,
output: [
{
file: 'dist/react-confetti.cjs',
format: 'cjs',
globals,
sourcemap: true,
},
{
file: 'dist/react-confetti.mjs',
format: 'es',
globals,
sourcemap: true,
},
{
name: 'ReactConfetti',
file: 'dist/react-confetti.iife.js',
format: 'iife',
globals,
sourcemap: true,
},
{
name: 'ReactConfetti',
file: 'dist/react-confetti.umd.js',
format: 'umd',
globals,
sourcemap: true,
},
],
external,
plugins: [
pluginTs({
exclude: ['src/stories/**/*', 'rollup.config.ts'],
}),
],
},
{
input,
output: [
{ format: 'cjs', file: 'dist/react-confetti.d.cts' },
{ format: 'es', file: 'dist/react-confetti.d.mts' },
],
external,
plugins: [dts()],
},
]
export default config