prepare-cjs.js 463 B

1234567891011121314151617181920212223242526272829
  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. 'reactivity-transform',
  10. 'shared'
  11. ]
  12. let allFilesPresent = true
  13. for (const pkg of packagesToCheck) {
  14. if (
  15. !fs.existsSync(
  16. new URL(`../packages/${pkg}/dist/${pkg}.cjs.js`, import.meta.url)
  17. )
  18. ) {
  19. allFilesPresent = false
  20. break
  21. }
  22. }
  23. if (!allFilesPresent) {
  24. process.exit(1)
  25. }