check-dts.js 439 B

12345678910111213141516
  1. #!/usr/bin/env node
  2. const path = require('path')
  3. const glob = require('glob')
  4. process.chdir(path.join(__dirname, '..')) // start in project root
  5. let tmpDtsFiles = glob.sync('*.d.ts')
  6. if (tmpDtsFiles.length) {
  7. console.error(
  8. 'There are temp .d.ts files in the project root, which indicates that rollup-plugin-dts choked.\n' +
  9. 'This happens when there is a circular dependency or a bad package import.'
  10. )
  11. process.exit(1)
  12. }