Purgecss not working in my Laravel App
See original GitHub issueI am working on a project where I am using separate assets for frontend and backend.
I am trying to use purge css for frontend with specific folders and views. I don’t think it’s working. Can someone look into my configuration and tell me what to do?
mix.scripts([
'public/website/js/jquery-3.4.1.min.js',
'public/website/js/popper.min.js',
'public/website/js/bootstrap.min.js',
'public/website/js/slick.min.js',
'public/website/js/modernizr-webp.js',
'public/website/js/main.js',
'public/website/js/jssocials.min.js',
], 'public/website/js/script.js');
mix.styles([
'public/website/css/fontawesome.min.css',
'public/website/css/bootstrap.min.css',
'public/website/css/slick.css',
'public/website/css/slick-theme.css',
'public/website/css/jssocials.css',
'public/website/css/jssocials-theme-flat.css',
'public/website/css/style.css',
], 'public/website/css/main.css').purgeCss({
enabled: true,
paths: () => glob.sync([
path.join(__dirname, 'resources/views/website/**/*.blade.php'),
path.join(__dirname, 'resources/views/website/*.blade.php'),
path.join(__dirname, 'resources/views/includes/website.blade.php'),
path.join(__dirname, 'resources/views/auth/**/*.blade.php'),
path.join(__dirname, 'resources/views/auth/*.blade.php'),
path.join(__dirname, 'public/website/js/script.js'),
]),
});
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Laravel Mix and PurgeCss chain, not purging specified file ...
Trying to build out specific purgedCSS files for a project with rather large complete CSS file. However PurgeCSS refuses to only purge the...
Read more >Purgecss | Laravel Mix Extension
This package adds a purgeCss option to Laravel Mix, which installs PurgeCSS for you with a set of sensible defaults for Laravel applications....
Read more >Cleaning unused CSS with Purgecss and Laravel Mix
The site I'd been working on is written in Laravel and as it didn't have a backend it was a great candidate for...
Read more >How to use PurgeCSS with Laravel Mix in a Craft CMS Project.
PurgeCSS is a a package that you can use to strip out unused CSS from your stylesheet, greatly reducing the file size when...
Read more >Laravel 8 + Tailwind PurgeCSS - Laracasts
When I run npm run production I expect that the app.css file to be purged of extra tailwind classes, but the resulting file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reverting back to 4.1.0 did the trick. Latest one didi not work on fresh laravel install with tailwind
@avvertix The newest version actually does work. You just have to add the
enabled: true
option.