installation of dependencies
npm create vite@latestnpm install @vitejs/plugin-react -Enpm install react react-dom -E
First configuration:
Configuration in the Vite configuration file: vite.config.js
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
});
Important
You can now change the file extensions from .js to.jsx. Make sure that the files where they are imported contain the jsx extension, for example, in the main HTML of the application.
Now install Eslint because it is important to start any project with this extension.
In package.json file add:
"eslintConfig": {
"extends": "./node_modules/standard/eslintrc.json"
}
npm install to install everything
and voila!, you have configured your project with React, vite and eslint from scratch.