-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathrollup.config.mjs
40 lines (39 loc) · 1 KB
/
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
import typescript from '@rollup/plugin-typescript'
import dts from 'rollup-plugin-dts'
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
import styles from 'rollup-plugin-styles'
import terser from '@rollup/plugin-terser'
import bundleSize from 'rollup-plugin-bundle-size'
import sizes from 'rollup-plugin-sizes'
export default [
// Main Package
{
input: 'src/index.ts',
output: [
{
file: 'build/index.cjs.js',
format: 'cjs',
},
{
file: 'build/index.esm.js',
format: 'esm',
},
],
plugins: [
styles({ minimize: true }),
peerDepsExternal({ includeDependencies: true }),
typescript({ module: 'ESNext', target: 'es6' }),
terser(),
bundleSize(),
sizes(),
],
external: ['object-property-assigner', 'object-property-extractor'],
},
// Types
{
input: './build/dts/index.d.ts',
output: [{ file: 'build/index.d.ts', format: 'es' }],
external: [/\.css$/],
plugins: [dts()],
},
]