1 | import nodeResolve from "@rollup/plugin-node-resolve";
|
2 | import babel from "@rollup/plugin-babel";
|
3 | import copy from "rollup-plugin-copy";
|
4 | import terser from "@rollup/plugin-terser";
|
5 | import minifyHTML from "rollup-plugin-minify-html-literals";
|
6 | import summary from "rollup-plugin-summary";
|
7 |
|
8 | const input = {
|
9 | bundle: "src/bundle.js",
|
10 | "components/api-proxy": "src/components/api-proxy.js",
|
11 | "components/analytics": "src/components/analytics.js",
|
12 | "components/livechat": "src/components/livechat.js",
|
13 | };
|
14 |
|
15 | export default [
|
16 |
|
17 | {
|
18 | input,
|
19 | preserveEntrySignatures: "strict",
|
20 | output: {
|
21 | dir: "dist",
|
22 | chunkFileNames: "internals/_[hash].js",
|
23 | entryFileNames: "[name].js",
|
24 | format: "es",
|
25 | },
|
26 | external: ["https://cdn.zywave.com/dompurify@2.2.9/dist/purify.es.js"],
|
27 | plugins: [
|
28 | nodeResolve(),
|
29 | babel({
|
30 | babelHelpers: "runtime",
|
31 | presets: [
|
32 | [
|
33 | "@babel/preset-env",
|
34 | {
|
35 | bugfixes: true,
|
36 | },
|
37 | ],
|
38 | ],
|
39 | plugins: [
|
40 | [
|
41 | "@babel/plugin-transform-runtime",
|
42 | {
|
43 | absoluteRuntime: false,
|
44 | corejs: false,
|
45 | helpers: true,
|
46 | regenerator: false,
|
47 | },
|
48 | ],
|
49 | ],
|
50 | }),
|
51 | minifyHTML.default(),
|
52 | terser(),
|
53 | summary(),
|
54 | copy({
|
55 | targets: [
|
56 | { src: "src/loader.js", dest: "dist" },
|
57 | {
|
58 | src: "../../../node_modules/@oddbird/popover-polyfill/dist/popover.css",
|
59 | dest: "dist/internals/_polyfills/popover",
|
60 | },
|
61 | ],
|
62 | }),
|
63 | ],
|
64 | },
|
65 |
|
66 | {
|
67 | input,
|
68 | preserveEntrySignatures: "strict",
|
69 | output: {
|
70 | dir: "dev",
|
71 | chunkFileNames: "internals/_[name]-[hash].js",
|
72 | entryFileNames: "[name].js",
|
73 | format: "es",
|
74 | },
|
75 | external: ["https://cdn.zywave.com/dompurify@2.2.9/dist/purify.es.js"],
|
76 | plugins: [
|
77 | nodeResolve({ exportConditions: ["development"] }),
|
78 | babel({
|
79 | babelHelpers: "runtime",
|
80 | presets: [
|
81 | [
|
82 | "@babel/preset-env",
|
83 | {
|
84 | bugfixes: true,
|
85 | },
|
86 | ],
|
87 | ],
|
88 | plugins: [
|
89 | [
|
90 | "@babel/plugin-transform-runtime",
|
91 | {
|
92 | absoluteRuntime: false,
|
93 | corejs: false,
|
94 | helpers: true,
|
95 | regenerator: false,
|
96 | },
|
97 | ],
|
98 | ],
|
99 | }),
|
100 | copy({
|
101 | targets: [
|
102 | {
|
103 | src: "../../../node_modules/@oddbird/popover-polyfill/dist/popover.css",
|
104 | dest: "dev/internals/_polyfills/popover",
|
105 | },
|
106 | ],
|
107 | }),
|
108 | ],
|
109 | },
|
110 | ];
|