-
Notifications
You must be signed in to change notification settings - Fork 15
/
rollup.config.mjs
47 lines (46 loc) · 1.07 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
import resolve from "@rollup/plugin-node-resolve";
import svg from "rollup-plugin-svg";
import sucrase from "@rollup/plugin-sucrase";
import css from "rollup-plugin-css-only";
import copy from "@polypoly-eu/rollup-plugin-copy-watch";
export default {
input: "src/poly-look.js",
output: {
file: "dist/poly-look.js",
format: "iife",
name: "polyLook",
globals: {
react: "React",
"react-dom": "ReactDOM",
},
},
plugins: [
svg({ base64: true }),
css({ output: "css/poly-look.css" }),
sucrase({
transforms: ["jsx"],
production: true,
}),
resolve(),
copy({
targets: [
{
src: ["src/static/fonts/jost*"],
dest: "dist/fonts",
},
],
}),
],
external: ["react", "react-dom"],
onwarn: (warning) => {
// overwite the default warning function
if (
warning.code === "CIRCULAR_DEPENDENCY" &&
warning.cycle[0].match(/d3-/)
) {
return;
} else if (warning.code !== "THIS_IS_UNDEFINED") {
console.error(`(!) ${warning.message}`);
}
},
};