I am currently trying to create a web application, using TailwindCSS for styles, PostCSS as the processor and parcel-bundler
as a bundler, based off this boilerplate from GitHub.
For some reason, every time I run yarn build
, everything compiles right except for the CSS. The *.css
file in dist/
is completely unchanged from the source file, and it seems like the file is not being processed at all...
My package.json
{
"license": "MIT",
"scripts": {
"dev": "parcel src/index.html",
"build": "parcel build --no-minify src/index.html"
},
"devDependencies": {
"@fullhuman/postcss-purgecss": "^4.0.3",
"autoprefixer": "^9",
"parcel-bundler": "^1.12.5",
"postcss": "^7",
"tailwindcss": "npm:@tailwindcss/postcss7-compat"
},
"dependencies": {
"@tailwindcss/forms": "^0.3.4",
}
}
main.css
(CSS source file, *.css
file in dist/
looks exactly like this)
/* purgecss start ignore */
@tailwind base;
@tailwind components;
@tailwind utilities;
/* purgecss end ignore */
.btn-orange {
@apply bg-gray-200 w-28 p-2 text-sm rounded hover:bg-yellow-500 transition-colors shadow-lg font-bold;
}
label {
@apply font-bold;
}
I have no idea what I'm doing wrong... I have used @tailwind
instead of @import
as suggested by many posts online, but for some reason the file is still not being processed. I am not sure if it is something wrong with PostCSS, or Parcel.