-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.cjs
52 lines (51 loc) · 1.33 KB
/
rollup.config.cjs
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
const typescript = require('@rollup/plugin-typescript');
const terser = require('@rollup/plugin-terser');
const resolve = require('@rollup/plugin-node-resolve');
const commonjs = require('@rollup/plugin-commonjs');
const alias = require('@rollup/plugin-alias');
const path = require('path');
const packageJson = require('./package.json');
module.exports = {
input: 'src/index.ts',
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: true,
},
{
file: packageJson.module,
format: 'es',
sourcemap: true,
},
],
plugins: [
alias({
entries: [
{ find: '@', replacement: path.resolve(__dirname, 'src') },
]
}),
resolve(),
commonjs(),
typescript({ tsconfig: './tsconfig.json' }),
terser({
ecma: 2015,
module: true,
toplevel: true,
compress: {
drop_console: true,
drop_debugger: true,
passes: 2,
dead_code: true,
},
mangle: {
properties: {
regex: /^_/,
},
},
output: {
comments: false,
},
}),
],
};