rollup.config.mjs 790 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-native';
  6. const inputs = ['./src/tabler-icons-react-native.ts'];
  7. const bundles = [
  8. {
  9. format: 'cjs',
  10. inputs,
  11. extension: 'cjs',
  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`
  25. }, {
  26. file: `dist/cjs/${outputFileName}.d.cts`
  27. }],
  28. plugins: [dts()],
  29. },
  30. ...getRollupConfig(pkg, outputFileName, bundles, {
  31. react: 'react',
  32. 'react-native-svg': 'react-native-svg',
  33. })
  34. ];