Today we are going to learn how we can generate a development build with React Vite. This will generate the dist folder with development configuration.

To do this, we need to go to the package.json file and add this command inside «scripts»: {
"scripts": { ... "build-dev": "tsc && vite build --mode development", ... }
And to use it we have to run this command:
npm build-dev
This way we will generate the build in a development environment:
if (process.env.NODE_ENV === "development") {
