Hmm, it might be a purgecss config issue. It looks like purge is removing most of your styles.
Here's a more general purgecss config I have for a Laravel app that works well. Maybe try this?
purge: [
'./app/**/*.php',
'./resources/**/*.php',
],
When i run 'npm run dev' or 'npm run watch' everything works as supposed to. But when i run 'npm run prod', my site get's all messed up. It actually not fails to compile, but some vue components act weird en some styling is messed up. My guess is that it has something to do with either vue components or the tailwindui i installed recently.
Maybe the problem could be solved easily but i dont know much about this tailwind.config, webpack.mix and package.json.
Does anyone has a suggestion? Anything that puts me in the right direction would help.
TAILWIND.CONFIG
module.exports = {
purge: [
'./resources/views/**/*.blade.php',
'./resources/css/**/*.css',
],
theme: {
extend: {}
},
variants: {},
plugins: [
require('@tailwindcss/ui'),
]
}
PACKAGE.JSON
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"@tailwindcss/custom-forms": "^0.2",
"axios": "^0.19",
"browser-sync": "^2.26.7",
"browser-sync-webpack-plugin": "^2.0.1",
"cross-env": "^7.0",
"laravel-mix": "^5.0.1",
"laravel-mix-tailwind": "^0.1.0",
"lodash": "^4.17.13",
"resolve-url-loader": "^2.3.1",
"tailwindcss": "^1.4",
"vue": "^2.5.17",
"vue-template-compiler": "^2.6.10"
},
"dependencies": {
"@tailwindcss/ui": "^0.3.1",
"tailwindcss": "^1.4.6"
}
}
WEBPACK.MIX
const mix = require('laravel-mix');
require('laravel-mix-tailwind');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/js/app.js', 'public/js')
.postCss('resources/css/app.css', 'public/css')
.tailwind('./tailwind.config.js')
.browserSync('cityscanr.test');
if (mix.inProduction()) {
mix
.version();
}
@troj That should do it! I forgot to add the *.vue files in my reply. You can make it a bit more general if you want, but what you have is fine if you put all your vue components in that folder.
Please or to participate in this conversation.