From 29d01c4050fe91436d1fcaf5738a853d5e7d248d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tina=20M=C3=BCller?= Date: Tue, 18 Jun 2024 15:43:07 +0200 Subject: [PATCH] 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_ASSETPACK_SASSC` is set. --- lib/Mojolicious/Plugin/AssetPack/Pipe/Sass.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/Mojolicious/Plugin/AssetPack/Pipe/Sass.pm b/lib/Mojolicious/Plugin/AssetPack/Pipe/Sass.pm index 47e16be..7ce89de 100644 --- a/lib/Mojolicious/Plugin/AssetPack/Pipe/Sass.pm +++ b/lib/Mojolicious/Plugin/AssetPack/Pipe/Sass.pm @@ -61,9 +61,15 @@ sub process { $asset->content($store->save(\$css, $attrs))->FROM_JSON($attrs); } else { - my @args = (qw(sass -s), map { ('-I', $_) } @{$opts{include_paths}}); - push @args, '--scss' if $asset->format eq 'scss'; - push @args, qw(-t compressed) if $attrs->{minified}; + my @args; + if ($ENV{MOJO_PLUGIN_ASSETPACK_SASSC}) { + @args = (qw(sassc -s), map { ('-I', $_) } @{$opts{include_paths}}); + } + else { + @args = (qw(sass -s --trace), map { ('-I', $_) } @{$opts{include_paths}}); + push @args, '--scss' if $asset->format eq 'scss'; + push @args, qw(-t compressed) if $attrs->{minified}; + } $self->run(\@args, \$content, \my $css, undef); $asset->content($store->save(\$css, $attrs))->FROM_JSON($attrs); }