rollup.config.js 812 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import typescript from 'rollup-plugin-typescript2';
  2. import commonjs from 'rollup-plugin-commonjs';
  3. import external from 'rollup-plugin-peer-deps-external';
  4. import postcss from 'rollup-plugin-postcss';
  5. import resolve from 'rollup-plugin-node-resolve';
  6. import url from 'rollup-plugin-url';
  7. import svgr from '@svgr/rollup';
  8. import pkg from './package.json';
  9. export default {
  10. input: 'src/index.ts',
  11. output: [
  12. {
  13. file: pkg.main,
  14. format: 'cjs',
  15. exports: 'named',
  16. sourcemap: true,
  17. },
  18. {
  19. file: pkg.module,
  20. format: 'es',
  21. exports: 'named',
  22. sourcemap: true,
  23. },
  24. ],
  25. plugins: [
  26. external(),
  27. postcss(),
  28. url(),
  29. svgr(),
  30. resolve(),
  31. typescript({
  32. rollupCommonJSResolveHack: true,
  33. clean: true,
  34. }),
  35. commonjs(),
  36. ],
  37. };