-
Notifications
You must be signed in to change notification settings - Fork 0
Vite and Node.js: Running a Local Server
In order to build our frontend, we needed to see what our website looked like as we constructed it. In order to do this, we needed to run a local server which could host our website and show live edits. The tools we used for this were Node.js and Vite.
Vite is a development tool that comes with a local development server for building applications.
Vite, which is French for "fast", was built in order to deliver high speed server start up and updates.
When creating your own server, dependencies can often cause slow start up times, however Vite pre-bundles dependencies causing speeds to increase by a factor of ten to a hundred.
In bundler-based projects, rebuilding the entire bundle can be time consuming, and the time increases as the the size of the web application increases. Vite, however, uses Hot Module Replacement (HMR). Hot Module Replacement allows modules of the page to update themselves without affecting the entire page. In addition, Vite uses HTTP headers in order to boost full page reload speeds.
Bryan Lecza