-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
rollup.config.js
47 lines (45 loc) · 1.37 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
import typescriptPlugin from "@rollup/plugin-typescript"
import typescript from "typescript"
import { terser } from "rollup-plugin-terser"
const LICENSE = "/** serializr - (c) Michel Weststrate 2016 - MIT Licensed */"
export default {
input: "src/serializr.ts",
output: [
["es", false],
["es", true],
["umd", false],
["umd", true],
].map(([format, compress]) => ({
format: format,
entryFileNames: "[name].[format]" + (compress ? ".min" : "") + ".js",
sourcemap: true,
dir: "lib",
name: "serializr",
exports: "named",
plugins: compress
? [
terser({
compress: {
passes: 3,
unsafe: true,
ecma: 7
},
toplevel: true,
mangle: {
properties: { regex: /^_/ }
},
ie8: true,
output: {
preamble: LICENSE
}
}),
]
: [],
})),
plugins: [typescriptPlugin({ typescript })],
onwarn: function (warning, warn) {
if ("THIS_IS_UNDEFINED" === warning.code) return
// if ('CIRCULAR_DEPENDENCY' === warning.code) return
warn(warning)
},
}