rollup.config.mjs 762 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import fs from 'fs'
  2. import { getRollupConfig } from '../../.build/rollup-plugins.mjs'
  3. import dts from "rollup-plugin-dts";
  4. const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8'))
  5. const outputFileName = 'tabler-icons-react';
  6. const inputs = ['./src/tabler-icons-react.ts'];
  7. const bundles = [
  8. {
  9. format: 'cjs',
  10. extension: 'cjs',
  11. inputs,
  12. },
  13. {
  14. format: 'esm',
  15. inputs,
  16. preserveModules: true,
  17. extension: 'mjs',
  18. },
  19. ];
  20. export default [
  21. {
  22. input: inputs[0],
  23. output: [{
  24. file: `dist/esm/${outputFileName}.d.ts`, format: 'esm'
  25. }, {
  26. file: `dist/cjs/${outputFileName}.d.cts`, format: 'cjs'
  27. }],
  28. plugins: [dts()],
  29. },
  30. ...getRollupConfig(pkg, outputFileName, bundles, {
  31. react: 'react'
  32. })
  33. ];