| 1 | package Mojolicious::Plugin::AssetPack::Pipe::Sass; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use Mojo::Base 'Mojolicious::Plugin::AssetPack::Pipe'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use Mojolicious::Plugin::AssetPack::Util qw(checksum diag dumper load_module DEBUG); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Mojo::File; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Mojo::JSON qw(decode_json encode_json); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Mojo::Util; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 1 | my $FORMAT_RE = qr{^s[ac]ss$}; | |||||||||||||||||||||||||||
| 10 | 1 | my $IMPORT_RE = qr{ (?:^|[\n\r]+) ([^\@\r\n]*) (\@import \s+ (["']) (.*?) \3 \s* ;)}sx; | |||||||||||||||||||||||||||
| 11 | 1 | my $SOURCE_MAP_PLACEHOLDER = sprintf '__%s__', __PACKAGE__; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 1 | $SOURCE_MAP_PLACEHOLDER =~ s!::!_!g; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | ▶ | has functions => sub { +{} }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||
| 16 | 0 | ▶ | has generate_source_map => sub { shift->app->mode eq 'development' ? 1 : 0 }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=13.0
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub process { | ||||||||||||||||||||||||||
|
Subroutine
process: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 19 | 0 | my ($self, $assets) = @_; | |||||||||||||||||||||||||||
| 20 | 0 | my $store = $self->assetpack->store; | |||||||||||||||||||||||||||
| 21 | 0 | my %opts = (include_paths => [undef, @{$self->assetpack->store->paths}]); | |||||||||||||||||||||||||||
| 22 | 0 | my $file; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 0 | for my $name (keys %{$self->functions}) { | |||||||||||||||||||||||||||
| 25 | 0 | my $cb = $self->functions->{$name}; | |||||||||||||||||||||||||||
| 26 | 0 | ▶ | $opts{sass_functions}{$name} = sub { $self->$cb(@_); }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 0 | ▶ | if ($self->generate_source_map) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | 0 | $opts{source_map_file} = $SOURCE_MAP_PLACEHOLDER; | |||||||||||||||||||||||||||
| 31 | 0 | ▶ | $opts{source_map_file_urls} = $self->app->mode eq 'development' ? 1 : 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 0 | ▶ | return $assets->each(sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=15 SCAR=54.8
| |||||||||||||||||||||||||||||
| 35 | 0 | my ($asset, $index) = @_; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | ▶ | return if $asset->format !~ $FORMAT_RE; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | 0 | my ($attrs, $content) = ($asset->TO_JSON, $asset->content); | |||||||||||||||||||||||||||
| 39 | 0 | local $self->{checksum_for_file} = {}; | |||||||||||||||||||||||||||
| 40 | 0 | local $opts{include_paths}[0] = _include_path($asset); | |||||||||||||||||||||||||||
| 41 | 0 | $attrs->{minified} = $self->assetpack->minify; | |||||||||||||||||||||||||||
| 42 | 0 | ▶ | $attrs->{key} = sprintf 'sass%s', $attrs->{minified} ? '-min' : ''; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 0 | $attrs->{format} = 'css'; | |||||||||||||||||||||||||||
| 44 | 0 | $attrs->{checksum} = $self->_checksum(\$content, $asset, $opts{include_paths}); | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 0 | ▶ | return $asset->content($file)->FROM_JSON($attrs) if $file = $store->load($attrs); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 47 | 0 | ▶ | return if $asset->isa('Mojolicious::Plugin::AssetPack::Asset::Null'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 48 | 0 | ▶ | $opts{include_paths}[0] = $asset->path ? $asset->path->dirname : undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 49 | 0 | $opts{include_paths} = [grep {$_} @{$opts{include_paths}}]; | |||||||||||||||||||||||||||
| 50 | 0 | diag 'Process "%s" with checksum %s.', $asset->url, $attrs->{checksum} if DEBUG; | |||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 0 | ▶ | if ($self->{has_module} //= eval { load_module 'CSS::Sass'; 1 }) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"has_module"} //= eval {
do {
load_module("CSS::Sass");
1
}
}
MC/DC0%0/2
$self->{"has_module"} //= eval {
do {
load_module("CSS::Sass");
1
}
}
$self->{"has_module"}
eval {
do {
load_module("CSS::Sass");
1
}
}
Truth table0%0/3
A //= B
A= $self->{"has_module"}B= eval {
do {
load_module("CSS::Sass");
1
}
}
| |||||||||||||||||||||||||||||
| 53 | 0 | $opts{output_style} = _output_style($attrs->{minified}); | |||||||||||||||||||||||||||
| 54 | 0 | ▶ | $content = CSS::Sass::sass2scss($content) if $asset->format eq 'sass'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 55 | 0 | my ($css, $err, $stats) = CSS::Sass::sass_compile($content, %opts); | |||||||||||||||||||||||||||
| 56 | 0 | ▶ | if ($err) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 57 | 0 | die sprintf '[Pipe::Sass] Could not compile "%s" with opts=%s: %s', $asset->url, dumper(\%opts), $err; | |||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||
| 59 | 0 | $css = Mojo::Util::encode('UTF-8', $css); | |||||||||||||||||||||||||||
| 60 | 0 | ▶ | $self->_add_source_map_asset($asset, \$css, $stats) if $stats->{source_map_string}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 61 | 0 | $asset->content($store->save(\$css, $attrs))->FROM_JSON($attrs); | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | else { | ||||||||||||||||||||||||||||
| 64 | 0 | my @args = (qw(sass -s --trace), map { ('-I', $_) } @{$opts{include_paths}}); | |||||||||||||||||||||||||||
| 65 | 0 | ▶ | push @args, '--scss' if $asset->format eq 'scss'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 66 | 0 | ▶ | push @args, qw(-t compressed) if $attrs->{minified}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 67 | 0 | $self->run(\@args, \$content, \my $css, \my $err); | |||||||||||||||||||||||||||
| 68 | 0 | ▶ | my $exit = $? > 0 ? $? >> 8 : $?; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 69 | 0 | ▶ | if ($exit) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 70 | 0 | die sprintf '[Pipe::Sass] Could not compile "%s" with opts=%s: %s', $asset->url, dumper(\%opts), $err; | |||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||
| 72 | 0 | $asset->content($store->save(\$css, $attrs))->FROM_JSON($attrs); | |||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||
| 74 | 0 | }); | |||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 0 | ▶ | sub _add_source_map_asset { | ||||||||||||||||||||||||||
|
Subroutine
_add_source_map_asset: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 78 | 0 | my ($self, $asset, $css, $stats) = @_; | |||||||||||||||||||||||||||
| 79 | 0 | my $data = decode_json $stats->{source_map_string}; | |||||||||||||||||||||||||||
| 80 | 0 | my $source_map = Mojolicious::Plugin::AssetPack::Asset->new(url => sprintf('%s.css.map', $asset->name)); | |||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | # override "stdin" with real file | ||||||||||||||||||||||||||||
| 83 | 0 | ▶ | $data->{file} = sprintf 'file://%s', $asset->path if $asset->path; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 84 | 0 | $data->{sources}[0] = $data->{file}; | |||||||||||||||||||||||||||
| 85 | 0 | $source_map->content(encode_json $data); | |||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | 0 | my $relative = join '/', '..', $source_map->checksum, $source_map->url; | |||||||||||||||||||||||||||
| 88 | 0 | $$css =~ s!$SOURCE_MAP_PLACEHOLDER!$relative!; | |||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | # TODO | ||||||||||||||||||||||||||||
| 91 | 0 | $self->assetpack->{by_checksum}{$source_map->checksum} = $source_map; | |||||||||||||||||||||||||||
| 92 | 0 | $self->assetpack->{by_topic}{$source_map->url} = Mojo::Collection->new($source_map); | |||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | 0 | ▶ | sub _checksum { | ||||||||||||||||||||||||||
|
Subroutine
_checksum: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||
| 96 | 0 | my ($self, $ref, $asset, $paths) = @_; | |||||||||||||||||||||||||||
| 97 | 0 | my $ext = $asset->format; | |||||||||||||||||||||||||||
| 98 | 0 | my $store = $self->assetpack->store; | |||||||||||||||||||||||||||
| 99 | 0 | my @c = (checksum $$ref); | |||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | SEARCH: | ||||||||||||||||||||||||||||
| 102 | 0 | ▶ | while ($$ref =~ /$IMPORT_RE/gs) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 103 | 0 | my $pre = $1; | |||||||||||||||||||||||||||
| 104 | 0 | my $rel_path = $4; | |||||||||||||||||||||||||||
| 105 | 0 | my $mlen = length $2; | |||||||||||||||||||||||||||
| 106 | 0 | my @rel = split '/', $rel_path; | |||||||||||||||||||||||||||
| 107 | 0 | my $name = pop @rel; | |||||||||||||||||||||||||||
| 108 | 0 | my $start = pos($$ref) - $mlen; | |||||||||||||||||||||||||||
| 109 | 0 | my $dynamic = $rel_path =~ m!http://local/!; | |||||||||||||||||||||||||||
| 110 | 0 | my @basename = ("_$name", $name); | |||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | 0 | ▶ | next if $pre =~ m{^\s*//}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||
| 114 | # Follow sass rules for skipping, | ||||||||||||||||||||||||||||
| 115 | # ...with exception for special assetpack handling for dynamic sass include | ||||||||||||||||||||||||||||
| 116 | 0 | ▶ | next if $rel_path =~ /\.css$/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 117 | 0 | ▶ | next if $rel_path =~ m!^https?://! and !$dynamic; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$rel_path =~ m[^https?://]u and not $dynamic
MC/DC0%0/2
$rel_path =~ m[^https?://]u and not $dynamic
$rel_path =~ m[^https?://]u
not $dynamic
Truth table0%0/3
A and not(B)
A= $rel_path =~ m[^https?://]uB= not $dynamic
| |||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | 0 | ▶ | unshift @basename, "_$name.$ext", "$name.$ext" unless $name =~ /\.$ext$/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 120 | 0 | ▶ | my $imported = $store->asset([map { join '/', @rel, $_ } @basename], $paths) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 121 | or die qq([Pipe::Sass] Could not find "$rel_path" file in @$paths); | ||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | 0 | ▶ | if ($imported->path) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 124 | 0 | diag '@import "%s" (%s)', $rel_path, $imported->path if DEBUG >= 2; | |||||||||||||||||||||||||||
| 125 | 0 | local $paths->[0] = _include_path($imported); | |||||||||||||||||||||||||||
| 126 | 0 | push @c, $self->_checksum(\$imported->content, $imported, $paths); | |||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||
| 128 | else { | ||||||||||||||||||||||||||||
| 129 | 0 | diag '@import "%s" (memory)', $rel_path if DEBUG >= 2; | |||||||||||||||||||||||||||
| 130 | 0 | pos($$ref) = $start; | |||||||||||||||||||||||||||
| 131 | 0 | substr $$ref, $start, $mlen, $imported->content; # replace "@import ..." with content of asset | |||||||||||||||||||||||||||
| 132 | 0 | push @c, $imported->checksum; | |||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | 0 | return checksum join ':', @c; | |||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | 0 | ▶ | sub _include_path { | ||||||||||||||||||||||||||
|
Subroutine
_include_path: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 140 | 0 | my $asset = shift; | |||||||||||||||||||||||||||
| 141 | 0 | ▶ | return $asset->url if $asset->url =~ m!^https?://!; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 142 | 0 | ▶ | return $asset->path->dirname if $asset->path; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 143 | 0 | return ''; | |||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||
| 146 | 0 | ▶ | sub _install_sass { | ||||||||||||||||||||||||||
|
Subroutine
_install_sass: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 147 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 148 | 0 | $self->run([qw(ruby -rubygems -e), 'puts Gem.user_dir'], undef, \my $base); | |||||||||||||||||||||||||||
| 149 | 0 | chomp $base; | |||||||||||||||||||||||||||
| 150 | 0 | my $path = Mojo::File->new($base, qw(bin sass)); | |||||||||||||||||||||||||||
| 151 | 0 | ▶ | return $path if -e $path; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 152 | 0 | $self->app->log->warn('Installing sass... Please wait. (gem install --user-install sass)'); | |||||||||||||||||||||||||||
| 153 | 0 | $self->run([qw(gem install --user-install sass)]); | |||||||||||||||||||||||||||
| 154 | 0 | return $path; | |||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||
| 157 | 0 | ▶ | sub _output_style { | ||||||||||||||||||||||||||
|
Subroutine
_output_style: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 158 | 0 | ▶ | return $_[0] ? CSS::Sass::SASS_STYLE_COMPRESSED() : CSS::Sass::SASS_STYLE_NESTED(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | 1 | 1; | |||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | =encoding utf8 | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | =head1 NAME | ||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||
| 167 | Mojolicious::Plugin::AssetPack::Pipe::Sass - Process sass and scss files | ||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||
| 169 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | =head2 Application | ||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||
| 173 | plugin AssetPack => {pipes => [qw(Sass Css Combine)]}; | ||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||
| 175 | $self->pipe("Sass")->functions({ | ||||||||||||||||||||||||||||
| 176 | q[image-url($arg)] => sub { | ||||||||||||||||||||||||||||
| 177 | my ($pipe, $arg) = @_; | ||||||||||||||||||||||||||||
| 178 | return sprintf "url(/assets/%s)", $_[1]; | ||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||
| 180 | }); | ||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||
| 182 | =head2 Sass file | ||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||
| 184 | The sass file below shows how to use the custom "image-url" function: | ||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||
| 186 | body { | ||||||||||||||||||||||||||||
| 187 | background: #fff image-url('img.png') top left; | ||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||
| 190 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||
| 192 | L<Mojolicious::Plugin::AssetPack::Pipe::Sass> will process sass and scss files. | ||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||
| 194 | This module require either the optional module L<CSS::Sass> or the C<sass> | ||||||||||||||||||||||||||||
| 195 | program to be installed. C<sass> will be automatically installed using | ||||||||||||||||||||||||||||
| 196 | L<https://rubygems.org/> unless already available. | ||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||
| 198 | =head1 ATTRIBUTES | ||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||
| 200 | =head2 functions | ||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||
| 202 | $hash_ref = $self->functions; | ||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | Used to define custom SASS functions. Note that the functions will be called | ||||||||||||||||||||||||||||
| 205 | with C<$self> as the first argument, followed by any arguments from the SASS | ||||||||||||||||||||||||||||
| 206 | function. This invocation is EXPERIMENTAL, but will hopefully not change. | ||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||
| 208 | This attribute requires L<CSS::Sass> to work. It will not get passed on to | ||||||||||||||||||||||||||||
| 209 | the C<sass> executable. | ||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||
| 211 | See L</SYNOPSIS> for example. | ||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||
| 213 | =head2 generate_source_map | ||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||
| 215 | $bool = $self->generate_source_map; | ||||||||||||||||||||||||||||
| 216 | $self = $self->generate_source_map(1); | ||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||
| 218 | This pipe will generate source maps if true. Default is "1" if | ||||||||||||||||||||||||||||
| 219 | L<Mojolicious/mode> is "development". | ||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||
| 221 | See also L<http://thesassway.com/intermediate/using-source-maps-with-sass> and | ||||||||||||||||||||||||||||
| 222 | L<https://robots.thoughtbot.com/sass-source-maps-chrome-magic> for more | ||||||||||||||||||||||||||||
| 223 | information about the usefulness. | ||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||
| 225 | =head1 METHODS | ||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||
| 227 | =head2 process | ||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||
| 229 | See L<Mojolicious::Plugin::AssetPack::Pipe/process>. | ||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||
| 231 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||
| 233 | L<Mojolicious::Plugin::AssetPack>. | ||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||
| 235 | =cut | ||||||||||||||||||||||||||||