-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathrollup.config.js
More file actions
44 lines (41 loc) · 1.06 KB
/
rollup.config.js
File metadata and controls
44 lines (41 loc) · 1.06 KB
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
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import resolve from "@rollup/plugin-node-resolve";
import terser from "@rollup/plugin-terser";
import typescript from "rollup-plugin-typescript2";
import visualizer from "rollup-plugin-visualizer";
const isBundleVis = !!process.env.BUNDLE_VIS;
const Bundles = [
// [input, output, name]
["src/index.ts", "dist/x6.min.js", "X6"],
];
export default [
// Bundle for G2 umd entries.
...Bundles.map(([input, file, name], idx) => ({
input,
treeshake: {
preset: "smallest",
},
output: [
{
file,
name,
format: "umd",
sourcemap: false,
plugins: [isBundleVis && idx === Bundles.length - 1 && visualizer()],
},
],
plugins: [
resolve(),
commonjs(),
typescript({
useTsconfigDeclarationDir: true,
tsconfig: "./tsconfig.json",
exclude: ["__tests__/**"],
}),
json(),
terser(),
],
context: "window", // Disable 'THIS_IS_UNDEFINED' warnings
})),
];