Menu

We moved our portal build to Vite and stopped type checking for four months
📰

We moved our portal build to Vite and stopped type checking for four months

DEV Community: typescript·Sergey Shinder·about 23 hours ago
#LFntAcW3
#devtotypescript#devto#dev#build#type
Reading 0:00
15s threshold

Our customer portal is a React app written in TypeScript. Until March it was built by webpack with ts-loader, which reports type errors as build errors, so a green build also meant the code type checked. Nobody had written that down, because nobody had ever needed to.

In March we moved the build to Vite. Builds went from four minutes to fifty seconds, three people reviewed the pull request and the portal looked identical. Our package.json said "build": "vite build", copied from an internal example rather than from the Vite template.

In July customers began writing in about order confirmation pages that showed the total as £NaN. Three weeks earlier the API team had renamed total to totalPence in our shared types package and updated the call sites they could find. The confirmation page still read order.total. Under webpack that line would have stopped the build. Under Vite it went to production.

Vite does not type check.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.