Add Svelte to your project
Install Svelte using the Astro CLI:
Answer
Yes to all the question prompted by the CLI when installing Svelte.Add TailwindCSS to your project
Add Tailwind CSS using the Astro CLI:
Answer
Yes to all the question prompted by the CLI when installing TailwindCSS.Import the global CSS file
Import the
global.css file in the src/pages/index.astro file:src/pages/index.astro
Setup path aliases
Add the following code to the
tsconfig.json file to resolve paths:tsconfig.json
If needed, adapt the path aliases to your specific needs (learn more about it).
That's it
You can now start adding components to your project.The command above will add the
Button component to your project. You can then import it like this:index.astro
Remember to use the
client directives inside .astro files when dealing with interactive components (learn more about it).