rollup.config.js 776 B

123456789101112131415161718192021222324252627282930313233
  1. const { nodeResolve } = require("@rollup/plugin-node-resolve");
  2. const commonjs = require("@rollup/plugin-commonjs");
  3. const { babel } = require("@rollup/plugin-babel");
  4. const { terser } = require("rollup-plugin-terser");
  5. const umdGlobals = {
  6. react: "React",
  7. "prop-types": "PropTypes",
  8. };
  9. module.exports = [
  10. {
  11. input: "./src/index.js",
  12. output: {
  13. file: "dist/index.js",
  14. format: "umd",
  15. name: "reactDropzone",
  16. globals: umdGlobals,
  17. sourcemap: "inline",
  18. exports: "named",
  19. },
  20. external: Object.keys(umdGlobals),
  21. plugins: [
  22. nodeResolve(),
  23. commonjs({ include: "**/node_modules/**" }),
  24. babel({
  25. exclude: "**/node_modules/**",
  26. babelHelpers: "bundled",
  27. }),
  28. terser(),
  29. ],
  30. },
  31. ];