Skip to content

Instantly share code, notes, and snippets.

@deepanshumehtaa
Last active April 9, 2025 19:22
Show Gist options
  • Save deepanshumehtaa/364cc6bf42d89808956fd82af08e8b7d to your computer and use it in GitHub Desktop.
Save deepanshumehtaa/364cc6bf42d89808956fd82af08e8b7d to your computer and use it in GitHub Desktop.
Start ReactJS + Vite
Vite is a fast and efficient WebD build tool to build and serve web apps
1. instant server start and fast code reloading make development a breeze.
2. PROD builds are optimized for performance, resulting in smaller bundle sizes and faster load times.
3. not work seamlessly with older browsers.
4. Hot Module Replacement (HMR) is a feature that allows developers to update and reload individual modules (e.g., JavaScript files) without requiring a full page reload.
This enables a faster and more efficient development experience.
Install Node (Linux)
1. apt --fix-broken install
2. curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
3. sudo apt-get install -y nodejs
4. node -v
Create a Vite Project:
1. npm create vite@latest
2. after selecting framework select
i. JavaScript + SWC: SWC here is compiler (replace the default `babel`)
3. npm install
# skip vulnerabilities audit for devDependencies on install:
> npm install --no-audit --only=dev
> npm install --no-audit --only=prod
# for production
4.1 npm run dev --omit=dev
# for dev (this install devDependencies in package.json)
4.1 npm install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment