Boilerplate for projects using Vite with react.
- ReactJS
- Redux
- Redux Toolkit
- Styled Components
- React Testing Library
- Vitest
- Storybook
- Eslint
- Prettier
- Husky
- Lint-Staged
- Plop
To use environment variables we follow the Vite recommended model.
Obs: These files are included in .gitignore
Type the following command in your terminal to copy the example file and
rename it to .env.development.local:
cp .env-example .env.development.localLocal variables:
REACT_ENVIRONMENT = 'DEVELOPMENT'
Type the following command in your terminal to copy the example file and
rename it to .env:
cp .env-example .envProduction values:
REACT_ENVIRONMENT = 'PRODUCTION'
dev:app: run the application onhttp://localhost:5173/build:app: build for productionpreview:app: build for production and start a local serverhttp://localhost:4173/lint: runs the linter in all components and pagesformat: runs prettier to format all components and pagestest: runs vitest in watch modetest:coverage: runs vitest with coverage tablegenerate: runs plop to generate component filesstorybook: runs storybook onhttp://localhost:6006/storybook:build: create the production build of storybook
- Run the
yarn generatecommand and fill in the options - Start the
yarn dev:appcommand
- Run the
yarn preview:appcommand - Publish the files