Vite
Installation guide for Vite.
Install Tailwind CSS
Install tailwindcss
and its peer dependencies.
Then generate the tailwind.config.js
and postcss.config.js
files.
Add this import header in your main css file, src/index.css in this case:
Configure the tailwind template paths in tailwind.config.js:
Update tsconfig.json
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:
Update tsconfig.app.json
Add the following code to the tsconfig.app.json
file to resolve paths, for your IDE:
Update vite.config.ts
Add the following code to the vite.config.ts
so your app can resolve paths without error:
That's it!
You can now start adding components or hooks to your project.
The command will install the Button
component to your project. And you can import it in your code.