-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrollup.config.js
60 lines (54 loc) · 1.66 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
53
54
55
56
57
58
59
60
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import typescript from "rollup-plugin-typescript2";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import autoExternal from 'rollup-plugin-auto-external';
import visualizer from 'rollup-plugin-visualizer';
import dts from "rollup-plugin-dts";
const D3_WARNING = /Circular dependency.*d3-interpolate/
const directImports = {
bingmaps: 'src/components/bingmaps/index.ts',
common: 'src/components/common/index.ts',
footer: 'src/components/footer/index.ts',
graphikle: 'src/components/graphikle/index.ts',
markdownviewer: 'src/components/markdownviewer/index.ts',
signin: 'src/components/signin/index.ts',
styledtext: 'src/components/styledtext/index.ts',
}
const commonPlugins = [
nodeResolve(),
typescript({ resolveJsonModule: true, tsconfigOverride: { compilerOptions: { declaration: false } } }),
autoExternal(),
commonjs(),
json()
]
export default [
{
input: { ...directImports },
output: {
dir: 'dist',
format: 'esm',
sourcemap: true,
},
plugins: [
...commonPlugins,
visualizer({ filename: 'build_artifacts/esm_stats.html' })
],
onwarn(warning, warn) {
if (D3_WARNING.test(warning)) {
return;
}
warn(warning);
},
},
{
input: { ...directImports },
output: { dir: 'dist', format: 'esm' },
plugins: [
...commonPlugins,
dts(),
],
}
];