-
Notifications
You must be signed in to change notification settings - Fork 57
/
rollup.config.mjs
47 lines (45 loc) · 969 Bytes
/
rollup.config.mjs
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
import { nodeResolve } from '@rollup/plugin-node-resolve';
import { babel } from '@rollup/plugin-babel';
const sharedConfig = {
external: ['react', 'react-dom', 'react/jsx-runtime', 'prop-types', 'react-transition-state'],
plugins: [nodeResolve(), babel({ babelHelpers: 'bundled' })],
treeshake: {
moduleSideEffects: false,
propertyReadSideEffects: false
}
};
/**
* @type {import('rollup').RollupOptions}
*/
export default [
{
...sharedConfig,
input: 'src/index.js',
output: [
{
file: 'dist/index.js',
format: 'cjs',
interop: 'default'
},
{
preserveModules: true,
dir: 'dist/es',
format: 'es'
}
]
},
{
...sharedConfig,
input: 'src/style-utils/index.js',
output: [
{
file: 'dist/style-utils/index.cjs.js',
format: 'cjs'
},
{
file: 'dist/style-utils/index.js',
format: 'es'
}
]
}
];