-
Notifications
You must be signed in to change notification settings - Fork 24
/
rollup.config.js
50 lines (48 loc) · 1.42 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
import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import { terser } from "rollup-plugin-terser";
import serve from "rollup-plugin-serve";
import livereload from "rollup-plugin-livereload";
import css from "rollup-plugin-import-css";
import json from "rollup-plugin-json";
import yaml from "@rollup/plugin-yaml";
import nodepf from "rollup-plugin-node-polyfills";
import url from "@rollup/plugin-url";
const production = process.env.NODE_ENV == "production";
const watching = process.env.ROLLUP_WATCH;
export default {
external: [
"jsdom",
"jsdom/lib/jsdom/living/generated/utils",
"jsdom/lib/jsdom/utils",
],
input: "ui/src/app.js",
output: {
file: "ui/app-dist/app.js",
format: "iife",
sourcemap: true,
globals: {
"jsdom": "trash",
"jsdom/lib/jsdom/living/generated/utils": "trash",
"jsdom/lib/jsdom/utils": "trash",
},
},
plugins: [
watching && serve(),
watching && livereload(),
url({
limit: 10 * 1024,
include: ["**/*.woff", "**/*.woff2"],
emitFiles: true,
destDir: "./ui/app-dist/",
fileName: `[name][extname]`,
}),
css(),
json(),
yaml(),
resolve({ browser: true }),
commonjs(),
nodepf(),
production && terser(),
],
};