prepare-cjs.js 439 B

12345678910111213141516171819202122232425262728
  1. // @ts-check
  2. import fs from 'node:fs'
  3. const packagesToCheck = [
  4. 'compiler-sfc',
  5. 'compiler-core',
  6. 'compiler-dom',
  7. 'compiler-ssr',
  8. 'compiler-vapor',
  9. 'shared',
  10. ]
  11. let allFilesPresent = true
  12. for (const pkg of packagesToCheck) {
  13. if (
  14. !fs.existsSync(
  15. new URL(`../packages/${pkg}/dist/${pkg}.cjs.js`, import.meta.url),
  16. )
  17. ) {
  18. allFilesPresent = false
  19. break
  20. }
  21. }
  22. if (!allFilesPresent) {
  23. process.exit(1)
  24. }