1 | import { nodeResolve } from "@rollup/plugin-node-resolve";
|
2 | import json from "@rollup/plugin-json";
|
3 | import { terser } from "rollup-plugin-terser";
|
4 | import { babel } from "@rollup/plugin-babel";
|
5 |
|
6 | const config = {
|
7 | input: "dist/install-button.js",
|
8 | output: {
|
9 | dir: "dist/web",
|
10 | format: "module",
|
11 | },
|
12 | external: ["https://www.improv-wifi.com/sdk-js/launch-button.js"],
|
13 | preserveEntrySignatures: false,
|
14 | plugins: [
|
15 | nodeResolve(),
|
16 | babel({
|
17 | babelHelpers: "bundled",
|
18 | plugins: ["@babel/plugin-proposal-class-properties"],
|
19 | }),
|
20 | json(),
|
21 | ],
|
22 | };
|
23 |
|
24 | if (process.env.NODE_ENV === "production") {
|
25 | config.plugins.push(
|
26 | terser({
|
27 | ecma: 2019,
|
28 | toplevel: true,
|
29 | output: {
|
30 | comments: false,
|
31 | },
|
32 | })
|
33 | );
|
34 | }
|
35 |
|
36 | export default config;
|