Vite
Create project
Start by creating a new Vite project:
Add tailwindcss
Configure Tailwind CSS: Setup Tailwind CSS
TypeScript configuration
Edit tsconfig.json file
The current version of Vite splits TypeScript configuration into three files, two of which need to be edited.
Add the baseUrl
and paths
properties to the compilerOptions
section of the tsconfig.json
and
tsconfig.app.json
files:
Edit tsconfig.app.json file
Add the following code to the tsconfig.app.json
file to resolve paths, for your IDE:
Update vite.config.ts
Run the following command to install the @types/node
package:
Then, add the following code to the vite.config.ts so your app can resolve paths without errors:
Setup
Run the init
command to setup uilabs in your project:
You can use the -d
flag for defaults i.e yes
, Tailwind
, @/components
, yes
and yes
.
Configuration
You will be asked a few questions to configure uilabs.config.json
:
Add components
You can now start adding components to your project.
The command above will add the component to your project in the directory you specified during the initialization.