rollup.config.mjs 735 B

123456789101112131415161718192021222324252627282930313233343536
  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-preact';
  6. const inputs = ['./src/tabler-icons-preact.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`
  25. }, {
  26. file: `dist/cjs/${outputFileName}.d.cts`
  27. }],
  28. plugins: [dts()],
  29. },
  30. ...getRollupConfig(pkg, outputFileName, bundles, {
  31. preact: 'preact'
  32. })
  33. ];