Answer the question
In order to leave comments, you need to log in
How to properly set up inline purgecss in tailwindscc in laravel mix?
In a fresh project, laravel installed tailwindcss in accordance with points 1, 2, 3 https://tailwindcss.com/docs/installation/
(@tailwind inserted into app.scss)
Changed webpack.mix.js in accordance with what is described below , it turned out like this:
const mix = require("laravel-mix");
require("laravel-mix-postcss-config");
const tailwindcss = require('tailwindcss');
mix.setResourceRoot(process.env.APP_URL)
.js("resources/js/app.js", "public/js")
.sass("resources/sass/app.scss", "public/css")
.options({
processCssUrls: false,
postCss: [tailwindcss("./tailwind.config.js")],
})
body {
@apply bg-gray-400
}
then it works and the background color changes There module.exports = {
purge: {
content: [
"./resources/views/**/*.php",
"./resources/js/**/*.vue"
],
options: {
whitelist: ['bg-red-500', 'px-4'], // тест whitelist
}
},
theme: {
extend: {}
},
variants: {},
plugins: []
};
npx tailwindcss init --full
), but it doesn't change anything.
Answer the question
In order to leave comments, you need to log in
After updating to 1.6.1 and changing the app.scss piece to
...
/* purgecss start ignore */
@tailwind base;
@tailwind components;
@tailwind utilities;
/* purgecss end ignore */
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question