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 | import commonjs from "@rollup/plugin-commonjs";
|
6 |
|
7 | const config = {
|
8 | input: "dist/install-button.js",
|
9 | output: {
|
10 | dir: "dist/web",
|
11 | format: "module",
|
12 | },
|
13 | external: ["https://www.improv-wifi.com/sdk-js/launch-button.js"],
|
14 | preserveEntrySignatures: false,
|
15 | plugins: [
|
16 | commonjs(),
|
17 | nodeResolve({
|
18 | browser: true,
|
19 | preferBuiltins: false,
|
20 | }),
|
21 | babel({
|
22 | babelHelpers: "bundled",
|
23 | plugins: [
|
24 | "@babel/plugin-proposal-class-properties",
|
25 | "@babel/plugin-transform-logical-assignment-operators",
|
26 | ],
|
27 | }),
|
28 | json(),
|
29 | ],
|
30 | };
|
31 |
|
32 | if (process.env.NODE_ENV === "production") {
|
33 | config.plugins.push(
|
34 | terser({
|
35 | ecma: 2019,
|
36 | toplevel: true,
|
37 | format: {
|
38 | comments: false,
|
39 | },
|
40 | })
|
41 | );
|
42 | }
|
43 |
|
44 | export default config;
|