
A beginner's guide to ViteJS: A modernized frontend tool
14 November, 2022
9
9
2
Contributors
Introduction
What is ViteJS, and why you should use it?
How does ViteJS work?
Advantages of ViteJS
1) Hot Module Replacement (HMR): An awesome feature - HMR in javascript bundlers saves the changes that you've done in the source code and you don't need to refresh the browser to see the changes that you've done, It instantly shows you the output. Also, HMR speed is the bottleneck for the developers who code using webpack.
2) Configuration Option: If you want complete privacy for your project or want to own your project you can change the vite.config.js in the existing working directory of the project.
3) Module Resolving: Browser's nowadays don't support module imports where you can import from a package. Whereas, Vite looks for bare import specifiers in your javascript files and rewrites them, and utilizes them.
Features of ViteJS
1) Faster builds: As we already know how fast is vite. Here vite offers faster build times with ESbuild. Esbuild is a bundler that is written in Go. It is much faster than any other bundler.
2) Framework support: Vite has a quality boilerplate for frameworks like React, Vue, Preact, etc. Other boilerplates also support Typescript. Vite offers a consistent tooling experience to its users.
3) Improved CSS support: Lately, Vite has improved their CSS support they've also offered some new features for CSS support like CSS splitting, URL re-bashing, and some more.
4) New Plugin System: The new plugin system leverages unique Hot module replacement and offers API to add middleware to the dev server.
5) Support for.JSX and . TSX Files: Vite offers great support to .jsx and .tsx files with ESbuild for transpilation.
Building an app using ViteJS

ViteJS app folder structure

Live Server
Why choose ViteJS?
1.
It is built keeping SPA in mind.
2.
3.
like Rails or Laravel, etc. Then vite offers you backend
integration support too.
Conclusion
web
development
develevate
hotintech
vitejs