pre-dev-sfc.js 419 B

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