rollup.config.js 781 B

123456789101112131415161718192021222324252627282930313233343536
  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. 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: [
  14. nodeResolve(),
  15. babel({
  16. babelHelpers: "bundled",
  17. plugins: ["@babel/plugin-proposal-class-properties"],
  18. }),
  19. json(),
  20. ],
  21. };
  22. if (process.env.NODE_ENV === "production") {
  23. config.plugins.push(
  24. terser({
  25. ecma: 2019,
  26. toplevel: true,
  27. output: {
  28. comments: false,
  29. },
  30. })
  31. );
  32. }
  33. export default config;