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