-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.cjs.js
48 lines (44 loc) · 1.08 KB
/
rollup.config.cjs.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
import resolve from "@rollup/plugin-node-resolve";
import progress from "rollup-plugin-progress";
import sizes from "rollup-plugin-sizes";
import { sizeSnapshot } from "rollup-plugin-size-snapshot";
import analyze from "rollup-plugin-analyzer";
const limitBytes = 1e6;
const onAnalysis = ({ bundleSize }) => {
if (bundleSize < limitBytes) return;
console.log(`Bundle size exceeds ${limitBytes} bytes: ${bundleSize} bytes`);
return process.exit(1);
};
module.exports = {
input: "build/es6/slughorn.js",
output: {
name: "Slughorn",
file: "build/slughorn.cjs.js",
format: "cjs"
},
external: [
],
plugins: [
resolve(),
// babel({
// // babelHelpers: 'bundled',
// babelrc: false,
// presets: [
// ["@babel/env",
// {
// // modules: false,
// targets: {
// node: "current"
// }
// }
// ]
// ]
// })
progress({
clearLine: true // default: true
}),
sizes(),
sizeSnapshot(),
analyze({ onAnalysis, skipFormatted: false })
]
};