Vite Frontend Tooling taste
Prompt
# Vite Frontend Tooling taste of a fast-feedback web developer - Start new single-page apps and component playgrounds on Vite with the official framework plugin instead of a custom webpack setup. Confidence: 0.85 - Keep `vite.config.ts` in TypeScript with `defineConfig`, and keep it short enough to read in one screen. Confidence: 0.80 - Run type checking separately with `tsc --noEmit` in CI and in a watcher, since Vite only strips types and never checks them. Confidence: 0.95 - Use path aliases sparingly, define them once in `tsconfig.json`, and mirror them in Vite with a plugin such as `vite-tsconfig-paths`. Confidence: 0.75 - Expose only `VITE_`-prefixed environment variables to client code and never put secrets in them. Confidence: 0.95 - Type `import.meta.env` in a `vite-env.d.ts` file so missing or misspelled variables fail at compile time. Confidence: 0.80 - Configure the dev server proxy for backend APIs instead of enabling permissive CORS on the backend just for local development. Confidence: 0.85 - Use Vitest for unit and component tests so tests share the same config, transforms and aliases as the app. Confidence: 0.90 - Lazy-load routes and heavy widgets with dynamic `import()` and let Rollup split chunks, rather than hand-tuning `manualChunks` early. Confidence: 0.80 - Inspect bundle size with `rollup-plugin-visualizer` before releases and treat a large new dependency as a review topic. Confidence: 0.75 - Import assets through the module graph so they get hashed file names, keeping `public/` for files that need fixed URLs like `robots.txt`. Confidence: 0.85 - Set an explicit `build.target` that matches the browsers you support, instead of relying on the default. Confidence: 0.70 - Generate source maps for production builds and upload them to your error tracker rather than serving them publicly. Confidence: 0.80 - Prefer native CSS features and CSS modules or Tailwind over heavy CSS-in-JS runtimes in Vite projects. Confidence: 0.70 - Keep the plugin list small and remove plugins that duplicate built-in features such as JSON imports or CSS handling. Confidence: 0.80 - Use `vite preview` to smoke-test the production build locally before deploying, since dev and build use different pipelines. Confidence: 0.85 - Pin Vite and plugin versions in the lockfile and upgrade them together, reading the migration guide for major versions. Confidence: 0.85 - Use library mode with `vite build --lib` plus a declaration generator when publishing a component package, and mark peer dependencies as external. Confidence: 0.75 - Fix slow cold starts by checking `optimizeDeps` and large barrel files before blaming Vite itself. Confidence: 0.70 - Fail CI on build warnings about circular imports or missing exports instead of letting them pile up. Confidence: 0.65
Credits
- Contributor
- @f
- Collection
- prompts.chatby Fatih Kadir Akın & contributors (CC0 1.0)
More
Other prompts
Acropolis at Golden Sunrise: 15-Shot Historical Documentary with 1-Second Hard Cuts (15s Video)Quiet Waitress, Brutal Lesson: 30-Second Korean Restaurant & Kitchen Fight Sequence (Action Video)Black-and-White Manga Ink Sketch: Messy-Bun Daydreamer Portrait (9:16 JSON)Art Appreciation GuideBlockchain Development TutorCareer Counselor #2