Minification and concatenation of CSS and Javascript (with Plack?)

Pierre M piemas25 at gmail.com
Sun Nov 24 00:49:27 GMT 2013


Ok, now I've tried
Plack::Middleware::Assets<https://metacpan.org/pod/Plack::Middleware::Assets>with
the right list of files but nothing seems to happen:
 - the chrome dev tools don't indicate that the files have been minified or
concatenated (which might be normal as it's happening server-side?)
 - the page loading time doesn't improve; while when i concatenated the
files manually, the loading time decreased significantly.

I've also tried Plack::App::MCCS
<https://metacpan.org/pod/Plack::App::MCCS>by doing
    my $app = builder {
        # Loading some Plack::Middlewares...
        MyApp->dance;
    }
    builder {
        mount '/public' => Plack::App::MCCS->new(root => '/public');
        mount '/' => $app;
    }
which gives a similar result.

I probably did something wrong (but not wrong enough that the app doesn't
run). I might end up putting some print statements inside these modules, to
see what's going on. Sleepy time now. I'll investigate further on Monday.



---
I check email a couple times daily; to reach me sooner, you can send me a
text message via this page: https://awayfind.com/mascip


On 23 November 2013 23:47, Pierre M <piemas25 at gmail.com> wrote:

> > does the exemple in the docs, or t/basic.t in the distribution not point
> you in the right direction?  Is there something missing from the docs that
> is causing you pain?
> Haha! I'm remembering now what I thought last week: my files are not all
> in the same folder, so I have to list them all first. I had tried
> <**/*.css> and the wildcard didn't work; I left that in the code last week,
> and this week assumed it did work. Sorry for a question whose answer I had.
>
> Plack::App::MCCS <https://metacpan.org/pod/Plack::App::MCCS> seems good.
> How to you use it with a Dancer2 app? (what is $app in the case of a
> Dancer2 app?)
>


More information about the london.pm mailing list