Project Setup
-
Creating the Project
First, create your Vite project using the following command:
-
Select Project Options
- Select
React
orSolid
as the framework. - Then, select
TypeScript
for the language.
Hit Enter after each selection to proceed.
- Select
-
Go to the Project Directory and Install Dependencies
Once your project is created, navigate to the project directory and install the required dependencies:
-
Install
vite-tsconfig-paths
PluginTo manage TypeScript paths easily, install the
vite-tsconfig-paths
plugin: -
Configure
vite.config.ts
Open your
vite.config.ts
file and configure it to use thevite-tsconfig-paths
plugin: -
Configure
tsconfig.json
Next, update your
tsconfig.json
to set thebaseUrl
tosrc
, allowing you to use absolute imports from thesrc
directory. -
Start the Development Server
Now, you can start the development server: