-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.mjs
43 lines (41 loc) · 971 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
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import del from 'rollup-plugin-delete';
import typescript from 'rollup-plugin-typescript2';
const pkg = require('./package.json');
export default [
{
input: 'src/index.ts',
external: Object.keys({ ...pkg.devDependencies, ...pkg.dependencies }),
plugins: [
del({ targets: 'dist/*' }),
nodeResolve(),
typescript({
clean: true,
tsconfig: './tsconfig.build.json',
}),
commonjs({
exclude: 'node_modules',
ignoreGlobal: true,
}),
terser({
mangle: false,
}),
],
output: [
{
file: pkg.main,
format: 'cjs',
sourcemap: true,
exports: 'named',
},
{
file: pkg.module,
format: 'esm',
sourcemap: true,
exports: 'named',
},
],
},
];