-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrollup.config.js
More file actions
38 lines (37 loc) · 867 Bytes
/
rollup.config.js
File metadata and controls
38 lines (37 loc) · 867 Bytes
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 commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import dts from 'rollup-plugin-dts';
import execute from 'rollup-plugin-execute';
import typescript from 'rollup-plugin-typescript2';
export default [
{
input: 'src/index.ts',
output: [
{
format: 'esm',
dir: 'dist/esm',
},
{
format: 'cjs',
dir: 'dist/cjs',
},
],
plugins: [
typescript({ useTsconfigDeclarationDir: true }),
resolve({ browser: true, extensions: ['.js', '.ts'] }),
commonjs(),
],
watch: {
include: 'src/**',
},
},
{
input: 'src/index.ts',
output: {
format: 'es',
file: 'dist/types.d.ts',
},
plugins: [dts(), execute(['rm -f dist/types/*', 'mv dist/types.d.ts dist/types/index.d.ts'])],
watch: true,
},
];