tsc passes but Vite build fails on a const enum
TypeScript 5.5, Vite 5.3, Vue 3. tsc --noEmit is clean. npm run build dies with: error during build: RollupError: 'Color' is not exported by src/types.ts, imported by src/components/Picker.vue. Color is a const enum in types.ts. Dev server works because esbuild transpiles per-file. Why does the production build disagree with tsc? I have seen this on two projects now and it always surprises someone.
4 replies