-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.mjs
42 lines (40 loc) · 1.14 KB
/
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
import path from "path";
import size from "rollup-plugin-bundle-size";
import terser from "@rollup/plugin-terser";
function trim() {
return {
name: "trim",
generateBundle(options, bundle) {
if (options.file.match(/\.min\.js$/)) {
const key = path.basename(options.file);
bundle[key].code = bundle[key].code.trim();
}
}
};
}
export default {
input: "src/Ramstack.HtmxToolkit/Assets/htmx-toolkit.js",
treeshake: "smallest",
output: [{
file: "src/Ramstack.HtmxToolkit/Assets/htmx-toolkit.js",
}, {
file: "src/Ramstack.HtmxToolkit/Assets/htmx-toolkit.min.js",
plugins: [terser({
output: {
comments: false
},
compress: {
passes: 5,
ecma: 2020,
drop_console: false,
drop_debugger: true,
pure_getters: true,
arguments: true,
unsafe_comps: true,
unsafe_math: true,
unsafe_methods: true
}
})]
}],
plugins: [trim(), size()]
};