AssetPack.pm

filter: Statementstmt 91.4% 139 / 152 Branchbran 75.0% 45 / 60 Conditioncond 66.6% 20 / 30 MC/DCmcdc 43.7% 7 / 16 Subroutinesub 87.5% 21 / 24 Podpod 100% 5 / 5 totaltotal 82.5% 237 / 287 CC 53 SCAR 19.4
CC
53
Cov
84%
_process
12.3
register
11.6
_process_from_def
10.1
CRAP 7.0
« AssetPack/Pipe/TypeScript.pm ↑ Summary AssetPack/Pipe/Png.pm »
1 package Mojolicious::Plugin::AssetPack;
2 15 ▶use Mojo::Base 'Mojolicious::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 15 ▶use Mojo::Util qw(deprecated trim xml_escape);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 15 ▶use Mojolicious::Plugin::AssetPack::Asset::Null;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 15 ▶use Mojolicious::Plugin::AssetPack::Store;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 15 ▶use Mojolicious::Plugin::AssetPack::Util qw(diag has_ro load_module DEBUG);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 15 our $VERSION = '2.15';
10  
11 14 ▶has minify => sub { shift->_app->mode eq 'development' ? 0 : 1 };
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
(shift())->_app->mode eq 'development' ? : 10 4 14
12  
13 20 ▶has route => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
14 20 shift->_app->routes->any([qw(HEAD GET)] => '/asset/:checksum/*name')->name('assetpack')->to(cb => \&_serve);
15 15 };
16  
17 20 ▶has store => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
18 20 my $self = shift;
19 Mojolicious::Plugin::AssetPack::Store->new(
20 20 classes => [@{$self->_app->static->classes}],
21 paths => [$self->_app->home->rel_file('assets')],
22 ua => $self->ua,
23 );
24 15 };
25  
26 21 ▶has_ro ua => sub { Mojo::UserAgent->new->max_redirects(3) };
Subroutine __ANON__: called CC=1 SCAR=0.0
27  
28 3 ▶sub pipe {
Subroutine pipe: called CC=1 SCAR=0.0
Pod documented
29 3 my ($self, $needle) = @_;
30 3 return +(grep { $_ =~ /::$needle\b/ } @{$self->{pipes}})[0];
31 }
32  
33 28 ▶sub process {
Subroutine process: called CC=7 SCAR=19.5
Pod documented
34 28 my ($self, $topic, @input) = @_;
35  
36 28 ▶ $self->route unless $self->{route_added}++;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"route_added"}++ 19 9 28
37 28 ▶ return $self->_process_from_def($topic) unless @input;
Branch: 1 branch
BranchTrueFalseTotal
unless @input 8 20 28
38  
39 # TODO: The idea with blessed($_) is that maybe the user can pass inn
40 # Mojolicious::Plugin::AssetPack::Sprites object, with images to generate
41 # CSS from?
42 20 my $assets = Mojo::Collection->new;
43 20 for my $url (@input) {
44 26 ▶ my $asset = Scalar::Util::blessed($url) ? $url : $self->store->asset($url);
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($url) ? : 10 16 26
45 26 ▶ die qq(Could not find input asset "$url".) unless Scalar::Util::blessed($asset);
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($asset) 1 25 26
46 25 push @$assets, $asset;
47 }
48  
49 0 ▶ return $self->tap(sub { $_->{input}{$topic} = $assets }) if $self->{lazy};
Subroutine __ANON__: not called CC=1 SCAR=1.2
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"lazy"} 0 19 19
50 19 return $self->_process($topic => $assets);
51 }
52  
53 0 ▶sub processed {
Subroutine processed: not called CC=2 SCAR=17.9
Pod documented
54 0 my ($self, $topic) = @_;
55 0 ▶ $self->_process($topic => $self->{input}{$topic}) unless $self->{by_topic}{$topic}; # Ensure asset is processed
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"by_topic"}{$topic} 0 0 0
56 0 return $self->{by_topic}{$topic};
57 }
58  
59 21 ▶sub register {
Subroutine register: called CC=10 SCAR=24.5
Pod documented
60 21 my ($self, $app, $config) = @_;
61 21 ▶ my $helper = $config->{helper} || 'asset';
Condition100%2/2
$config->{'helper'} || 'asset'
l!l
120
MC/DC100%1/1
$config->{'helper'} || 'asset'
$config->{'helper'}
Truth table100%2/2
A
A= $config->{'helper'}
Aresult
11
00
62  
63 21 ▶ if ($app->renderer->helpers->{$helper}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($app->renderer->helpers->{$helper}) 0 21 21
64 0 return $app->log->debug("AssetPack: Helper $helper() is already registered.");
65 }
66  
67 21 $self->{input} = {};
68 21 ▶ $self->{lazy} ||= $ENV{MOJO_ASSETPACK_LAZY} // $config->{lazy} || 0;
Condition37%3/8
$self->{"lazy"} ||= ($ENV{"MOJO_ASSETPACK_LAZY"} // $config->{"lazy"}) || 0
l!l&&r!l&&!r
0021
($ENV{'MOJO_ASSETPACK_LAZY'} // $config->{'lazy'}) || 0
l!l
021
$ENV{"MOJO_ASSETPACK_LAZY"} // $config->{"lazy"}
l!l&&r!l&&!r
0021
MC/DC0%0/3
$self->{"lazy"} ||= ($ENV{"MOJO_ASSETPACK_LAZY"} // $config->{"lazy"}) || 0
$self->{"lazy"} $ENV{"MOJO_ASSETPACK_LAZY"} $config->{"lazy"}
Truth table0%0/4
A ||= B // C
A= $self->{"lazy"}B= $ENV{"MOJO_ASSETPACK_LAZY"}C= $config->{"lazy"}
ABCresult
1XX1
01X1
0011
0000
69 21 $app->defaults('assetpack.helper' => $helper);
70 21 $self->ua->server->app($app);
71 21 Scalar::Util::weaken($self->ua->server->{app});
72  
73 21 ▶ if (my $proxy = $config->{proxy} // {}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $proxy = $config->{"proxy"} // {}) 20 1 21
Condition100%2/2
$config->{"proxy"} // {}
l!l
120
MC/DC100%1/1
$config->{"proxy"} // {}
$config->{"proxy"}
Truth table100%2/2
A
A= $config->{"proxy"}
Aresult
11
00
74 20 ▶ local $ENV{NO_PROXY} = $proxy->{no_proxy} || join ',', grep {$_} $ENV{NO_PROXY}, $ENV{no_proxy}, '127.0.0.1',
Condition33%1/3
$proxy->{'no_proxy'} || join(',', grep({$_;} $ENV{'NO_PROXY'}, $ENV{'no_proxy'}, '127.0.0.1', '::1', 'localhost'))
l!l&&r!l&&!r
0200
MC/DC0%0/2
$proxy->{'no_proxy'} || join(',', grep({$_;} $ENV{'NO_PROXY'}, $ENV{'no_proxy'}, '127.0.0.1', '::1', 'localhost'))
$proxy->{'no_proxy'} join(',', grep({$_;} $ENV{'NO_PROXY'}, $ENV{'no_proxy'}, '127.0.0.1', '::1', 'localhost'))
Truth table33%1/3
A || B
A= $proxy->{'no_proxy'}B= join(',', grep({$_;} $ENV{'NO_PROXY'}, $ENV{'no_proxy'}, '127.0.0.1', '::1', 'localhost'))
ABresult
1X1
011
000
75 '::1', 'localhost';
76 20 diag 'Detecting proxy settings. (NO_PROXY=%s)', $ENV{NO_PROXY} if DEBUG;
77 20 $self->ua->proxy->detect;
78 }
79  
80 21 ▶ $self->_pipes($config->{pipes} || []);
Condition50%1/2
$config->{'pipes'} || []
l!l
210
MC/DC0%0/1
$config->{'pipes'} || []
$config->{'pipes'}
Truth table50%1/2
A
A= $config->{'pipes'}
Aresult
11
00
81 21 ▶ $app->helper($helper => sub { @_ == 1 ? $self : $self->_render_tags(@_) });
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 ? : 67 80 147
82 }
83  
84 0 ▶sub tag_for {
Subroutine tag_for: not called CC=2 SCAR=17.9
Pod documented
85 0 my $self = shift;
86 0 deprecated 'tag_for() is DEPRECATED in favor of Mojolicious::Plugin::AssetPack::Asset::tag_for()';
87 0 ▶ return $self->{tag_for} unless @_;
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 0 0 0
88 0 $self->{tag_for} = shift;
89 0 return $self;
90 }
91  
92 83 ▶sub _app { shift->ua->server->app }
Subroutine _app: called CC=1 SCAR=0.0
93  
94 16 ▶sub _correct_mode {
Subroutine _correct_mode: called CC=7 SCAR=19.5
95 16 my ($self, $args) = @_;
96  
97 16 ▶ while ($args =~ /\[(\w+)([!=]+)([^\]]+)/g) {
Branch: 1 branch
BranchTrueFalseTotal
if ($args =~ /\[(\w+)([!=]+)([^\]]+)/gu) 10 11 21
98 10 ▶ my $v = $1 eq 'minify' ? $self->minify : $self->_app->$1;
Branch: 1 branch
BranchTrueFalseTotal
$1 eq 'minify' ? : 1 9 10
99 10 diag "Checking $1: $v $2 $3" if DEBUG == 2;
100 10 ▶ return 0 if $2 eq '!=' and $v eq $3;
Branch: 1 branch
BranchTrueFalseTotal
if $2 eq "!=" and $v eq $3 1 9 10
Condition100%3/3
$2 eq "!=" and $v eq $3
!ll&&!rl&&r
721
MC/DC100%2/2
$2 eq "!=" and $v eq $3
$2 eq "!=" $v eq $3
Truth table100%3/3
A and B
A= $2 eq "!="B= $v eq $3
ABresult
0X0
100
111
101 9 ▶ return 0 if $2 ne '!=' and $v ne $3; # default to testing equality
Branch: 1 branch
BranchTrueFalseTotal
if $2 ne "!=" and $v ne $3 4 5 9
Condition100%3/3
$2 ne "!=" and $v ne $3
!ll&&!rl&&r
234
MC/DC100%2/2
$2 ne "!=" and $v ne $3
$2 ne "!=" $v ne $3
Truth table100%3/3
A and B
A= $2 ne "!="B= $v ne $3
ABresult
0X0
100
111
102 }
103  
104 11 return 1;
105 }
106  
107 21 ▶sub _pipes {
Subroutine _pipes: called CC=2 SCAR=7.0
108 21 my ($self, $names) = @_;
109  
110 $self->{pipes} = [
111 map {
112 21 ▶ my $class = load_module /::/ ? $_ : "Mojolicious::Plugin::AssetPack::Pipe::$_";
Branch: 1 branch
BranchTrueFalseTotal
/::/u ? : 0 33 33
113 33 diag 'Loading pipe "%s".', $class if DEBUG;
114 33 my $pipe = $class->new(assetpack => $self);
115 33 Scalar::Util::weaken($pipe->{assetpack});
116 33 $pipe;
117 } @$names
118 ];
119 }
120  
121 19 ▶sub _process {
Subroutine _process: called CC=11 SCAR=25.1
122 19 my ($self, $topic, $input) = @_;
123 19 my $assets = Mojo::Collection->new(@$input); # Do not mess up input
124  
125 19 local $Mojolicious::Plugin::AssetPack::Util::TOPIC = $topic; # Used by diag()
126  
127 19 for my $asset (@$assets) {
128 25 ▶ if (my $prev = $self->{by_topic}{$topic}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $prev = $self->{"by_topic"}{$topic}) 0 25 25
129 0 delete $asset->{$_} for qw(checksum format);
130 0 $asset->content($self->store->asset($asset->url));
131 }
132 25 $asset->checksum;
133 }
134  
135 19 for my $method (qw(before_process process after_process)) {
136 57 for my $pipe (@{$self->{pipes}}) {
137 96 ▶ next unless $pipe->can($method);
Branch: 1 branch
BranchTrueFalseTotal
unless $pipe->can($method) 64 32 96
138 32 local $pipe->{topic} = $topic;
139 32 diag '%s->%s("%s")', ref $pipe, $method, $topic if DEBUG;
140 32 $pipe->$method($assets);
141 }
142 }
143  
144 19 ▶ if (my $tag_for = $self->{tag_for}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $tag_for = $self->{"tag_for"}) 0 19 19
145 0 ▶ $_->{tag_for} or $_->{tag_for} = $tag_for for @$assets;
Branch: 1 branch
BranchTrueFalseTotal
$_->{"tag_for"} or $_->{"tag_for"} = $tag_for 0 0 0
146 }
147  
148 19 my @checksum = map { $_->checksum } @$assets;
149 19 $self->_app->log->debug(qq(Processed asset "$topic". [@checksum])) if DEBUG;
150 19 $self->{by_checksum}{$_->checksum} = $_ for @$assets;
151 19 $self->{by_topic}{$topic} = $assets;
152 19 $self->store->persist;
153 19 $self;
154 }
155  
156 8 ▶sub _process_from_def {
Subroutine _process_from_def: called CC=10 SCAR=23.1
157 8 my $self = shift;
158 8 ▶ my $file = shift || 'assetpack.def';
Condition50%1/2
shift() || 'assetpack.def'
l!l
08
MC/DC0%0/1
shift() || 'assetpack.def'
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
159 8 my $asset = $self->store->file($file);
160 8 my $topic = '';
161 8 my %process;
162  
163 8 ▶ die qq(Unable to load "$file".) unless $asset;
Branch: 1 branch
BranchTrueFalseTotal
unless $asset 0 8 8
164 8 diag qq(Loading asset definitions from "$file".) if DEBUG;
165  
166 8 for (split /\r?\n/, $asset->slurp) {
167 30 s/\s*\#.*//;
168 30 ▶ if (/^\<(\S*)\s+(\S+)\s*(.*)/) {
Branch: 2 branches
BranchTrueFalseTotal
if (/^\<(\S*)\s+(\S+)\s*(.*)/u) { } 16 14 30
elsif (/^\!\s*(.+)/u) { } 8 6 14
169 16 my ($class, $url, $args) = ($1, $2, $3);
170 16 ▶ next unless $self->_correct_mode($args);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_correct_mode($args) 5 11 16
171 11 my $asset = $self->store->asset($url);
172 11 ▶ die qq(Could not find input asset "$url".) unless Scalar::Util::blessed($asset);
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($asset) 1 10 11
173 10 ▶ bless $asset, 'Mojolicious::Plugin::AssetPack::Asset::Null' if $class eq '<';
Branch: 1 branch
BranchTrueFalseTotal
if $class eq "<" 0 10 10
174 10 push @{$process{$topic}}, $asset;
175 }
176 8 elsif (/^\!\s*(.+)/) { $topic = trim $1; }
177 }
178  
179 7 $self->process($_ => @{$process{$_}}) for keys %process;
180 7 $self;
181 }
182  
183 80 ▶sub _render_tags {
Subroutine _render_tags: called CC=4 SCAR=13.9
184 80 my ($self, $c, $topic, @attrs) = @_;
185 80 my $route = $self->route;
186  
187 80 ▶ $self->_process($topic => $self->{input}{$topic}) if $self->{lazy};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"lazy"} 0 80 80
188  
189 80 ▶ my $assets = $self->{by_topic}{$topic} ||= $self->_static_asset($topic);
Condition66%2/3
$self->{"by_topic"}{$topic} ||= $self->_static_asset($topic)
l!l&&r!l&&!r
7280
MC/DC0%0/2
$self->{"by_topic"}{$topic} ||= $self->_static_asset($topic)
$self->{"by_topic"}{$topic} $self->_static_asset($topic)
Truth table66%2/3
A ||= B
A= $self->{"by_topic"}{$topic}B= $self->_static_asset($topic)
ABresult
1X1
011
000
190 80 ▶ my %args = (base_url => $route->pattern->defaults->{base_url} || '', topic => $topic);
Condition100%2/2
$route->pattern->defaults->{'base_url'} || ''
l!l
179
MC/DC100%1/1
$route->pattern->defaults->{'base_url'} || ''
$route->pattern->defaults->{'base_url'}
Truth table100%2/2
A
A= $route->pattern->defaults->{'base_url'}
Aresult
11
00
191 80 $args{base_url} =~ s!/+$!!;
192  
193 return Mojo::ByteStream->new(
194 join "\n",
195 80 map { $_->tag_for->($_, $c, \%args, @attrs) }
196 80 grep { !$_->isa('Mojolicious::Plugin::AssetPack::Asset::Null') } @$assets
197 );
198 }
199  
200 29 ▶sub _serve {
Subroutine _serve: called CC=3 SCAR=11.0
201 29 my $c = shift;
202 29 my $helper = $c->stash('assetpack.helper');
203 29 my $self = $c->$helper;
204  
205 29 my $checksum = $c->stash('checksum');
206 29 ▶ if (my $asset = $self->{by_checksum}{$checksum}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $asset = $self->{"by_checksum"}{$checksum}) 25 4 29
207 25 $self->store->serve_asset($c, $asset);
208 25 return $c->rendered;
209 }
210  
211 4 my $topic = $c->stash('name');
212 4 ▶ if (my $assets = $self->{by_topic}{$topic}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $assets = $self->{"by_topic"}{$topic}) 2 2 4
213 2 return $self->store->serve_fallback_for_assets($c, $topic, $assets);
214 }
215  
216 2 $c->render(text => sprintf("// No such asset '%s'\n", xml_escape $topic), status => 404);
217 }
218  
219 8 ▶sub _static_asset {
Subroutine _static_asset: called CC=3 SCAR=11.1
220 8 my ($self, $topic) = @_;
221 8 ▶ my $asset = $self->store->asset($topic) or die qq(No assets registered by topic "$topic".);
Branch: 1 branch
BranchTrueFalseTotal
my $asset = $self->store->asset($topic) or die qq[No assets registered by topic "$topic".] 8 0 8
222 8 my $assets = Mojo::Collection->new($asset);
223 8 $self->{by_checksum}{$_->checksum} = $_ for @$assets;
224 8 return $assets;
225 }
226  
227 15 1;
228  
229 =encoding utf8
230  
231 =head1 NAME
232  
233 Mojolicious::Plugin::AssetPack - Compress and convert CSS, Less, Sass, JavaScript and CoffeeScript files
234  
235 =head1 SYNOPSIS
236  
237 =head2 Application
238  
239 use Mojolicious::Lite;
240  
241 # Load plugin and pipes in the right order
242 plugin AssetPack => {pipes => [qw(Less Sass Css CoffeeScript Riotjs JavaScript Combine)]};
243  
244 # define asset
245 app->asset->process(
246 # virtual name of the asset
247 "app.css" => (
248  
249 # source files used to create the asset
250 "sass/bar.scss",
251 "https://github.com/Dogfalo/materialize/blob/master/sass/materialize.scss",
252 )
253 );
254  
255 =head2 Template
256  
257 <html>
258 <head>
259 %= asset "app.css"
260 </head>
261 <body><%= content %></body>
262 </html>
263  
264 =head1 DESCRIPTION
265  
266 L<Mojolicious::Plugin::AssetPack> is a L<Mojolicious plugin|Mojolicious::Plugin> for processing static assets. The idea
267 is that JavaScript and CSS files should be served as one minified file to save bandwidth and roundtrip time to the
268 server.
269  
270 There are many external tools for doing this, but integrating them with L<Mojolicious> can be a struggle: You want to
271 serve the source files directly while developing, but a minified version in production. This assetpack plugin will
272 handle all of that automatically for you.
273  
274 Your application creates and refers to an asset by its topic (virtual asset name). The process of building actual
275 assets from their components is delegated to "pipe objects".
276  
277 =head1 GUIDES
278  
279 =over 2
280  
281 =item L<Mojolicious::Plugin::AssetPack::Guides::Tutorial>
282  
283 The tutorial will give an introduction to how AssetPack can be used.
284  
285 =item L<Mojolicious::Plugin::AssetPack::Guides::Developing>
286  
287 The "developing" guide will give insight on how to do effective development with AssetPack and more details about the
288 internals in this plugin.
289  
290 =item L<Mojolicious::Plugin::AssetPack::Guides::Cookbook>
291  
292 The cookbook has various receipes on how to cook with AssetPack.
293  
294 =back
295  
296 =head1 HELPERS
297  
298 =head2 asset
299  
300 $self = $app->asset;
301 $self = $c->asset;
302 $bytestream = $c->asset($topic, @args);
303 $bytestream = $c->asset("app.css", media => "print");
304  
305 C<asset()> is the main entry point to this plugin. It can either be used to
306 access the L<Mojolicious::Plugin::AssetPack> instance or as a tag helper.
307  
308 The helper name "asset" can be customized by specifying "helper" when
309 L<registering|/register> the plugin.
310  
311 =head1 ATTRIBUTES
312  
313 =head2 minify
314  
315 $bool = $self->minify;
316 $self = $self->minify($bool);
317  
318 Set this to true to combine and minify the assets. Defaults to false if
319 L<Mojolicious/mode> is "development" and true otherwise.
320  
321 =head2 route
322  
323 $route = $self->route;
324 $self = $self->route($route);
325  
326 A L<Mojolicious::Routes::Route> object used to serve assets. The default route
327 responds to HEAD and GET requests and calls
328 L<serve_asset()|Mojolicious::Plugin::AssetPack::Store/serve_asset> on L</store>
329 to serve the asset.
330  
331 The default route will be built and added to the L<application|Mojolicious>
332 when L</process> is called the first time.
333  
334 =head2 store
335  
336 $obj = $self->store;
337 $self = $self->store(Mojolicious::Plugin::AssetPack::Store->new);
338  
339 Holds a L<Mojolicious::Plugin::AssetPack::Store> object used to locate, store
340 and serve assets.
341  
342 =head2 tag_for
343  
344 Deprecated. Use L<Mojolicious::Plugin::AssetPack::Asset/renderer> instead.
345  
346 =head2 ua
347  
348 $ua = $self->ua;
349  
350 Holds a L<Mojo::UserAgent> which can be used to fetch assets either from local
351 application or from remote web servers.
352  
353 =head1 METHODS
354  
355 =head2 pipe
356  
357 $obj = $self->pipe($name);
358 $obj = $self->pipe("Css");
359  
360 Will return a registered pipe by C<$name> or C<undef> if none could be found.
361  
362 =head2 process
363  
364 $self = $self->process($topic => @assets);
365 $self = $self->process($definition_file);
366  
367 Used to process assets. A C<$definition_file> can be used to define C<$topic>
368 and C<@assets> in a separate file.
369  
370 C<$definition_file> defaults to "assetpack.def".
371  
372 =head2 processed
373  
374 $collection = $self->processed($topic);
375  
376 Can be used to retrieve a L<Mojo::Collection> object, with zero or more
377 L<Mojolicious::Plugin::AssetPack::Asset> objects.
378  
379 =head2 register
380  
381 $self->register($app, \%config);
382  
383 Used to register the plugin in the application. C<%config> can contain:
384  
385 =over 2
386  
387 =item * helper
388  
389 Name of the helper to add to the application. Default is "asset".
390  
391 =item * pipes
392  
393 This argument is mandatory and need to contain a complete list of pipes that is
394 needed. Example:
395  
396 $app->plugin(AssetPack => {pipes => [qw(Sass Css Combine)]);
397  
398 =item * proxy
399  
400 A hash of proxy settings. Set this to C<0> to disable proxy detection.
401 Currently only "no_proxy" is supported, which will set which requests that
402 should bypass the proxy (if any proxy is detected). Default is to bypass all
403 requests to localhost.
404  
405 See L<Mojo::UserAgent::Proxy/detect> for more information.
406  
407 =back
408  
409 =head1 SEE ALSO
410  
411 L<Mojolicious::Plugin::Webpack>.
412  
413 =head1 COPYRIGHT AND LICENSE
414  
415 Copyright (C) 2020, Jan Henning Thorsen
416  
417 This program is free software, you can redistribute it and/or modify it under
418 the terms of the Artistic License version 2.0.
419  
420 =head1 AUTHOR
421  
422 Jan Henning Thorsen - C<jhthorsen@cpan.org>
423  
424 Alexander Rymasheusky
425  
426 Mark Grimes - C<mgrimes@cpan.org>
427  
428 Per Edin - C<info@peredin.com>
429  
430 Viktor Turskyi
431  
432 =cut
« AssetPack/Pipe/TypeScript.pm ↑ Summary AssetPack/Pipe/Png.pm »