Issue
I'm a newbie and I'm gonna lose my mind. I watch every tutorial and read every documents. It's just not work. Anyone knows how to mix tailwind(postcss or cli) and vite ?
I want to use vanilla css with vite, and some tailwind at the same time. But it's recommended not to use tailwindcss CDN with vite.
First I'm creating my vanilla js project with vite and than trying to install tailwind and I do every step as they said. Then I prompt npm run dev voila error
Solution
Run the following commands to create a new Vite project: select Vanilla then Javascript
npm init vite@latest my-vite-project
select Vanilla , Enter then select JavaScript
cd my-vite-project
then Install npm
npm install
Install Tailwind CSS and its dependencies using npm:
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
Create a postcss.config.js file in the root of your project to configure PostCSS:
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
now run your project
npm run dev
Answered By - MrStranger
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.