-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
51 lines (47 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
39
40
41
42
43
44
45
46
47
48
49
50
51
/* eslint-disable global-require */
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import ts from "@wessberg/rollup-plugin-ts";
import { terser } from 'rollup-plugin-terser';
// -----------------------------------------------------------------------------
export default [
createConfig(false),
createConfig(true)
];
// -----------------------------------------------------------------------------
function createConfig(minimify) {
return {
input: './src/index.ts',
output: [
{
name: "MsgPackBigInt",
file: "./dist/msgpack-bigint" + (minimify ? ".min" : "") + ".js",
format: 'umd',
sourcemap: true,
exports: "auto"
}
],
plugins: [
ts({
tsconfig: "./tsconfig.json",
browserslist: [ "last 1 version", "> 1%" ]
}),
commonjs({
ignoreGlobal: true
}),
resolve({
preferBuiltins: false
}),
terser({
ecma: 2020,
...((!minimify) && {
compress: false,
mangle: false,
format: {
beautify: true
}
})
})
]
};
}