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 | presets: [
|
24 | [
|
25 | "@babel/preset-env",
|
26 | {
|
27 | targets: {
|
28 |
|
29 | chrome: "84",
|
30 | },
|
31 | },
|
32 | ],
|
33 | ],
|
34 | }),
|
35 | json(),
|
36 | ],
|
37 | };
|
38 |
|
39 | if (process.env.NODE_ENV === "production") {
|
40 | config.plugins.push(
|
41 | terser({
|
42 | ecma: 2019,
|
43 | toplevel: true,
|
44 | format: {
|
45 | comments: false,
|
46 | },
|
47 | })
|
48 | );
|
49 | }
|
50 |
|
51 | export default config;
|