Just found out about Vite. Better than using create-react-app, it was good while it lasted, now I am making my move to Vite!

Resource: https://vitejs.dev/guide/

This is how you would create a new project with Vite, fast !

  1. $ npm create vite@latest
  2. Give it a project Name
  3. Select the platform
  4. $ cd project name
  5. $ npm install
  6. localhost:3000
  7. done

 

Notes to run on SSL and publish to CloudFlare:

IN ORDER TO WORK WITH SSL, YOU WILL NEED TO RUN VITE ON SSL WITH PORT 5173 FOR CORS TO WORK
$ npm run dev -- --port 5173
$ npm run preview -- --port 5173

PUSH NEW VERSION TO CLOUDFLARE:
git add .
git commit -m "Wad on Detached HEADin GIT now in main"
npm run build:prod
npx wrangler pages publish dist

Add Login authentication via Laravel API

https://www.webune.com/forums/add-authentication-to-react-vite-using-laravel-backend.html

Here is another way of doing it - create a react app

  1. Command to create a new app:
    # npm 6.x
    $ npm create vite@latest [app-name] --template vue

    # npm 7+, extra double-dash is needed:
    $ npm create vite@latest [app-name] -- --template vue

    # yarn
    $ yarn create vite [app-name] --template vue
  2. $ cd [app-name]
  3. $ npm install
  4. $ npm run dev
  5. Local:   http://127.0.0.1:5173/

 

And yet another way:

  1. $ npm init @vitejs/app
  2. Give it a project Name
  3. Select the platform
  4. $ cd project name
  5. $ npm i
  6. Run Dev Server: $ npm run dev
  7. Run Build: $ npm run build
  8. Preview Build: $ npm run serve

Hope that helps.

l