-
Notifications
You must be signed in to change notification settings - Fork 211
/
rollup.config.js
52 lines (49 loc) · 1.11 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
48
49
50
51
52
import json from "@rollup/plugin-json";
import ts from "rollup-plugin-ts";
import bundleSize from "rollup-plugin-bundle-size";
import { terser } from "rollup-plugin-terser";
const plugins = (browserslist, declaration) => [
json(),
ts({
tsconfig: (resolvedConfig) => ({
...resolvedConfig,
declaration,
declarationMap: declaration,
}),
transpiler: "babel",
babelConfig: { presets: ["@babel/preset-env"] },
browserslist,
}),
bundleSize(),
];
const outputs = [
{
input: "src/index.ts",
output: {
file: "build/vega-datasets.module.js",
format: "esm",
sourcemap: true,
},
plugins: plugins(undefined, true)
},
{
input: "src/index.ts",
output: [
{
file: "build/vega-datasets.js",
format: "umd",
sourcemap: true,
name: "vegaDatasets",
},
{
file: "build/vega-datasets.min.js",
format: "iife",
sourcemap: true,
name: "vegaDatasets",
plugins: [terser()],
},
],
plugins: plugins("defaults and not IE 11", false)
},
];
export default outputs;