-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
38 lines (37 loc) · 1.04 KB
/
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
import path from 'path';
import { terser } from 'rollup-plugin-terser';
import typescript from 'rollup-plugin-typescript2';
import clear from 'rollup-plugin-clear';
export default [
{
plugins: [
clear({
targets: [path.resolve(process.cwd(), 'lib')],
}),
typescript(),
terser({
toplevel: true,
compress: {
passes: 3,
pure_getters: true,
unsafe: true,
},
output: {
comments: false,
},
}),
],
input: path.resolve(process.cwd(), 'src/index.ts'),
output: [
{
file: path.resolve(process.cwd(), 'lib/index.cjs'),
format: 'cjs',
},
{
file: path.resolve(process.cwd(), 'lib/index.js'),
format: 'es',
},
],
external: ['react', 'react-dom/server', 'vira-18n'],
},
];