tsup.config.ts 397 B

12345678910111213141516171819
  1. import { defineConfig } from 'tsup'
  2. export default defineConfig(options => ({
  3. entry: [
  4. 'src/index.ts',
  5. 'src/prm.ts',
  6. 'src/yrm.ts',
  7. ],
  8. clean: true,
  9. minify: !options.watch,
  10. format: ['esm'],
  11. // require shims
  12. banner: {
  13. js: `
  14. import { createRequire as topLevelCreateRequire } from 'module';
  15. const require = topLevelCreateRequire(import.meta.url);
  16. `,
  17. },
  18. }))