-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.prod.config.js
49 lines (46 loc) · 1.31 KB
/
rollup.prod.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
// SPDX-FileCopyrightText: © 2021 Tech and Software Ltd.
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-uk.ltd.TechAndSoftware-1.0
import resolve from '@rollup/plugin-node-resolve';
import { terser } from "rollup-plugin-terser";
const PREAMBLE = `// SPDX${''}-FileCopyrightText: (c) 2021 Tech and Software Ltd.
// SPDX${''}-FileCopyrightText: (c) 2017 dosaygo
// SPDX${''}-License-Identifier: AGPL-3.0-only OR LicenseRef-uk.ltd.TechAndSoftware-1.0
// LicenseRef-uk.ltd.TechAndSoftware-1.0 refers to https://tech-and-software.ltd.uk/LICENSES/LicenseRef-uk.ltd.TechAndSoftware-1.0.txt`;
export default {
input: {
"teletext-service": 'src/ModuleExports.js'
},
output: [
{
entryFileNames: '[name].min.js',
dir: 'public/dist',
format: 'es',
sourcemap: true,
compact: true,
preferConst: true,
}
],
plugins: [
terser({
ecma: 2016,
toplevel: true,
compress: {
drop_console: true,
passes: 2,
pure_getters: true,
unsafe: true,
unsafe_symbols: true,
unsafe_arrows: true,
},
mangle: {
properties: {
regex: /^_.+|.+_$/, // ^_.+ for private methods, and .+_$ for internal methods
},
},
format: {
preamble: PREAMBLE
}
}),
resolve(),
]
};