-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.mjs
55 lines (53 loc) · 1.9 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
43
44
45
46
47
48
49
50
51
52
53
54
55
// rollup.config.mjs
import json from "@rollup/plugin-json";
import nodeResolve from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import alias from "@rollup/plugin-alias";
const plugins = [
typescript({
declaration: false,
}),
nodeResolve(),
json(),
alias({
entries: {
// "lit/static-html$": "lit/static-html.js",
"lit/decorators": "lit/decorators.js",
// "lit/directive$": "lit/directive.js",
// "lit/directives/until$": "lit/directives/until.js",
// "lit/directives/class-map$": "lit/directives/class-map.js",
// "lit/directives/style-map$": "lit/directives/style-map.js",
"lit/directives/if-defined": "lit/directives/if-defined.js",
// "lit/directives/guard$": "lit/directives/guard.js",
// "lit/directives/cache$": "lit/directives/cache.js",
"lit/directives/repeat": "lit/directives/repeat.js",
// "lit/directives/live$": "lit/directives/live.js",
// "lit/directives/keyed$": "lit/directives/keyed.js",
// "lit/polyfill-support$": "lit/polyfill-support.js",
// "@lit-labs/virtualizer/layouts/grid":
// "@lit-labs/virtualizer/layouts/grid.js",
// "@lit-labs/virtualizer/polyfills/resize-observer-polyfill/ResizeObserver":
// "@lit-labs/virtualizer/polyfills/resize-observer-polyfill/ResizeObserver.js",
// "@lit-labs/observers/resize-controller":
// "@lit-labs/observers/resize-controller.js",
},
}),
];
export default {
input: "src/energy-sankey.ts",
output: {
dir: "dist",
format: "es",
inlineDynamicImports: true,
},
plugins,
moduleContext: (id) => {
const thisAsWindowForModules = [
"node_modules/@formatjs/intl-utils/lib/src/diff.js",
"node_modules/@formatjs/intl-utils/lib/src/resolve-locale.js",
];
if (thisAsWindowForModules.some((id_) => id.trimRight().endsWith(id_))) {
return "window";
}
},
};