Skip to content

Commit c0fd34e

Browse files
committed
Optionally use sassc
ruby's sass is officially abandoned, and it has problems with some css files, for example the latest bootstrap css, so it would be good to have the option to use sassc. Or even other sass implementations. This PR will use sassc if `MOJO_PLUGIN_ASSETPAACK_SASSC` is set.
1 parent 9839a51 commit c0fd34e

File tree

1 file changed

+9
-3
lines changed
  • lib/Mojolicious/Plugin/AssetPack/Pipe

1 file changed

+9
-3
lines changed

lib/Mojolicious/Plugin/AssetPack/Pipe/Sass.pm

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,15 @@ sub process {
6161
$asset->content($store->save(\$css, $attrs))->FROM_JSON($attrs);
6262
}
6363
else {
64-
my @args = (qw(sass -s), map { ('-I', $_) } @{$opts{include_paths}});
65-
push @args, '--scss' if $asset->format eq 'scss';
66-
push @args, qw(-t compressed) if $attrs->{minified};
64+
my @args;
65+
if ($ENV{MOJO_PLUGIN_ASSETPACK_SASSC}) {
66+
@args = (qw(sassc -s), map { ('-I', $_) } @{$opts{include_paths}});
67+
}
68+
else {
69+
@args = (qw(sass -s --trace), map { ('-I', $_) } @{$opts{include_paths}});
70+
push @args, '--scss' if $asset->format eq 'scss';
71+
push @args, qw(-t compressed) if $attrs->{minified};
72+
}
6773
$self->run(\@args, \$content, \my $css, undef);
6874
$asset->content($store->save(\$css, $attrs))->FROM_JSON($attrs);
6975
}

0 commit comments

Comments
 (0)