rollup.config.mjs 846 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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-vue';
  6. const inputs = ['./src/tabler-icons-vue.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: [
  29. dts({
  30. compilerOptions: {
  31. preserveSymlinks: false
  32. }
  33. })
  34. ],
  35. },
  36. ...getRollupConfig(pkg, outputFileName, bundles, {
  37. vue: 'vue',
  38. })
  39. ];