To clone and use this template type the following commands:
npx degit chrisuser/vite-react-component my-component
cd my-component
Then, based on your package manager:
npm install
npm run dev
yarn
yarn dev
Tip
Remember to update the project name inside the package.json
file and to change the /REPO_NAME/
string inside the vite.config.ts
one.
In the project directory, you can run:
npm run dev
or
yarn dev
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
npm run build
or
yarn build
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
npm run lint
or
yarn lint
Creates a .eslintcache
file in which ESLint cache is stored. Running this command can dramatically improve ESLint's running time by ensuring that only changed files are linted.
This is the structure of the files in the project:
β
βββ .github # github workflows/actions
βββ lib # component files
βββ src # source files
β βββ App.css
β βββ App.tsx
β βββ main.tsx
β βββ vite-env.d.ts
βββ .eslintrc.js
βββ .gitignore
βββ index.html
βββ package.json
βββ README.md
βββ tsconfig-build-docs.json
βββ tsconfig-build.json
βββ tsconfig.json
βββ tsconfig.node.json
βββ vite.config.json # main vite configurations
βββ yarn.lock
This template was created by following this guide by Andreas RiedmΓΌller.
You can learn more in the Vite documentation.
To learn React, check out the React documentation.
If you have a suggestion that would make this component better feel free to fork the project and open a pull request or create an issue for any idea or bug you find.
Remeber to follow the Contributing Guidelines.