tailwindcss classes are not loading. Does anybody here knows the cause?
I have installed tailwindcss using node.
package.json:
{
"repository": {},
"description": " ",
"license": "MIT",
"scripts": {
"deploy": "NODE_ENV=production tailwindcss --postcss --minify --input=css/app.css --output=../priv/static/assets/app.css",
"build": "node esbuild.js"
},
"dependencies": {
"@editorjs/editorjs": "^2.25.0",
"@editorjs/list": "^1.7.0",
"daisyui": "^2.0.2",
"sortablejs": "^1.12.0"
},
"devDependencies": {
"@compodoc/live-server": "^1.2.3",
"@tailwindcss/forms": "^0.4.0",
"autoprefixer": "^10.4.2",
"esbuild-sass-plugin": "^2.2.3",
"postcss": "^8.4.6",
"postcss-import": "^14.0.2",
"prettier-plugin-tailwindcss": "^0.1.7",
"tailwindCSS.includeLanguages": {
"phoenix-heex": "html"
},
"tailwindcss": "^3.0.23"
}
}
Assets.deploy command:
"assets.deploy": [
"cmd --cd assets npm run deploy",
"esbuild default --minify",
"phx.digest"
]
esbuild.js:
const esbuild = require("esbuild");
const { sassPlugin } = require("esbuild-sass-plugin");
const postcss = require("postcss");
const autoprefixer = require("autoprefixer");
// Generate CSS/JS Builds
esbuild
.build({
entryPoints: ["./css/index.scss"],
outdir: "css",
bundle: true,
metafile: true,
watch: false,
plugins: [
sassPlugin({
async transform(source) {
const { css } = await postcss([autoprefixer]).process(source);
return css;
},
}),
],
})
.then(() => console.log("⚡ Build complete! ⚡"));