JeffreyWay / laravel-mix-tailwind

mix.tailwind()
347 stars 25 forks source link

mix --production no work in project #32

Open welitonjjosedev opened 3 years ago

welitonjjosedev commented 3 years ago

hi guys..

in development the webpack works well, but when I run yarn production the css doesn't work.

Can someone help me?

`const mix = require('laravel-mix');

require('mix-tailwindcss');

mix .js('resources/js/app.js', 'public/prod/js') .postCss('resources/css/app.css', 'public/prod/css', [ require('tailwindcss')('./tailwind.config.js') ]) .tailwind() .vue({version: 3}); `

mangcoding commented 3 years ago

anyone solve this problem? i found same issue here

juloxrox commented 3 years ago

Hi guys, I encountered the same, somehow due to the purgeCss array in tailwind config. I just removed everything from there and I got the assets compiled and minimized correctly

SlyDave commented 3 years ago

You appear to be double configuring tailwind by including it as a postCss plugin and calling tailwind() which does the same thing...? so in your instance this plugin isn't required. or you need to remove the plugin configuration from postCss

Either with this plugin:

const mix = require('laravel-mix');

require('mix-tailwindcss');

mix
.js('resources/js/app.js', 'public/prod/js')
.postCss('resources/css/app.css', 'public/prod/css')
.tailwind()
.vue({version: 3});

Or without

const mix = require('laravel-mix');

mix
.js('resources/js/app.js', 'public/prod/js')
.postCss('resources/css/app.css', 'public/prod/css', [
require('tailwindcss')('./tailwind.config.js')
])
.vue({version: 3});