-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.mjs
48 lines (45 loc) · 1.46 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
import nodeResolve from "@rollup/plugin-node-resolve";
import babel from "@rollup/plugin-babel";
import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import typescript2 from "rollup-plugin-typescript2";
import terser from "@rollup/plugin-terser";
import ignore from "./rollup-plugins/rollup-ignore-plugin.js";
const dev = process.env.ROLLUP_WATCH;
const IGNORED_FILES = [
"@material/mwc-ripple/mwc-ripple.js",
"@material/mwc-notched-outline/mwc-notched-outline.js",
"@material/mwc-list/mwc-list.js",
"@material/mwc-list/mwc-list-item.js",
"@material/mwc-menu/mwc-menu-surface.js",
"@material/mwc-menu/mwc-menu.js",
"@material/mwc-icon/mwc-icon.js",
"@material/mwc-tab/mwc-tab.js",
"@material/mwc-tab-indicator/mwc-tab-indicator.js",
"@material/mwc-tab-scroller/mwc-tab-scroller.js",
"@material/web/elevation/elevation.js",
"@material/web/focus/md-focus-ring.js",
"@material/web/ripple/ripple.js",
];
export default {
input: "src/main.ts",
output: {
file: "polr-ytube-media-card.js",
format: "es",
inlineDynamicImports: true,
},
plugins: [
ignore({
files: IGNORED_FILES.map((file) => require.resolve(file)),
}),
nodeResolve(),
json(),
commonjs(),
typescript2(),
babel({
babelHelpers: 'bundled',
exclude: "node_modules/**"
}),
!dev && terser(),
],
};