HTMLMin / Laravel-HTMLMin

A simple HTML minifier for Laravel 5, 6, 7, 8 & 9.
MIT License
1.02k stars 117 forks source link

Doesn't work #110

Open BrunoMCTeixeira opened 6 years ago

BrunoMCTeixeira commented 6 years ago

Laravel 5.6, I've set blade to true and it does nothing

level39 commented 6 years ago

@BrunoMCTeixeira You need to clear the view cache. Just run php artisan view:clear and reload the page to view the minified source.

Stanislas-Poisson commented 6 years ago

Thanks, forget to clear the cache :D

iec989 commented 6 years ago

I've done what DevFlick says, plus composer install --optimize-autoloader php artisan config:cache

But I keep seeing my code like below? image

Any ideas?

zenichanin commented 6 years ago

Doesn't work for me either.

rfpludwick commented 6 years ago

I have the same problem, on Laravel 5.2:

config/app.php:

<?php
return [
    //...
    'providers' => [
        //...
        HTMLMin\HTMLMin\HTMLMinServiceProvider::class,
    ],
    'aliases' => [
        //...
        'HTMLMin' => HTMLMin\HTMLMin\Facades\HTMLMin::class,
    ]
];

config/htmlmin.php:

<?php
return [
    //...
    'blade' => TRUE,
];

Commands executed:

php artisan vendor:publish
php artisan view:clear
php artisan config:cache

EDIT

If I turn 'force' => TRUE I get it to minify. I would assume that shouldn't be required, however.

leabdalla commented 6 years ago

Please add this cache instructions to readme file.

panique commented 6 years ago

Same here, even after reading the README like 10 times it's totally unclear how to use this lib. Can you please add clear information on how to use ?

dawidnawrot commented 5 years ago

@rfpludwick It's important to note that if you have any inline js in your blade file it will not going to be minified without force option. If you however move your inline js code into separate file it's going to work just fine. @rodrigopedra Why there's no such info in readme???

laraben commented 5 years ago

i can't make it work, i've tried everything . Blade => true, Force => true , php artisan view:clear php artisan config:cache

but it doesn't do any changes EDIT Apparently changes are only affected when you do a change in your existing blade files

kashifleo55 commented 4 years ago

Working but after minifying html java script not working can any one guide me on this.Thanks

laraben commented 4 years ago

For your css and javascript use purgecss. Spatie has a zero configuration package for it. And works insanely good.

Le mar. 17 sept. 2019 à 15:13, Muhammad Kashif notifications@github.com a écrit :

Working but after minifying html java script not working can any one guide me on this.Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HTMLMin/Laravel-HTMLMin/issues/110?email_source=notifications&email_token=AID5RPHSBUGSYHCFQULV6PDQKDJXVA5CNFSM4ES74EI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD64PHCY#issuecomment-532214667, or mute the thread https://github.com/notifications/unsubscribe-auth/AID5RPBTRT6V2ZN63VDEOS3QKDJXVANCNFSM4ES74EIQ .

tanthammar commented 4 years ago

tried force and all other recommendations in this thread. Nothing happens.

tranghaviet commented 4 years ago

I must set "force" to true. the html also does not fully minify image

osbre commented 3 years ago

Same. Nothing happens BTW I use Lumen 8 and I set "blade", "force" to "true" in the config.

Update: it works. Clear views cache in Lumen using:

rm storage/framework/views/*.php
dsampaolo commented 2 years ago

I just can't use this package.

Tried to set my app_env to prodution, manually remove view cached/compiled files, try to "artisan view:clear" and "config:clear", set blade AND force to true : nothing happens.