1
0

rollup.config.js 540 B

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