I am trying to add tailwind to vue project, in order to do this I am following the next steps:
Version of vue
vue --version
@vue/cli 4.3.1
Create project
vue create tailwindproject
(node-sass, babel, router, eslint, with dedicated files)
Install tailwind
npm install tailwindcss
Create css file on:
touch ./src/styles/tailwind.scss
Copy the following content on ./src/assets/styles/tailwind.scss
@tailwind base;
@tailwind components;
@tailwind utilities;
Add the following line into main.js
import './assets/styles/tailwind.scss'
Execute
npm run serve
And appears the following message
Failed to resolve loader: sass-loader You may need to install it.
Install sass-loader with
npm install --save sass-loader
And appear the following error:
Module build failed (from ./node_modules/sass-loader/dist/cjs.js): Error: Cannot find module 'sass'
I solved this with:
npm install --save-dev node-sass
Run server again, but the view looks without tailwind css.
are there any way of install correctly tailwind with sass and vue4?
Thanks