Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make CSS::Sass an optional prereqs even for SASS processing
  • Loading branch information
zoffixznet committed Jul 14, 2016
1 parent e60bb8f commit 385a25a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app.pl
Expand Up @@ -7,13 +7,12 @@

app->static->paths(['html']);

my $has_extra_modules = eval {
require CSS::Sass;
require Mojolicious::Plugin::AssetPack;
1;
};
if ( eval { require Mojolicious::Plugin::AssetPack; 1; } ) {
unless ( eval { require CSS::Sass } ) {
app->log->debug('CSS::Sass not loaded. Relying on `sass` program'
. ' to process SASS');
}

if ( $has_extra_modules ) {
plugin AssetPack => { pipes => [qw/Sass JavaScript Combine/] };
app->asset->process('app.css' => 'sass/style.scss' );

Expand All @@ -26,8 +25,9 @@
app->log->debug('...Done');
}
else {
app->log->debug( 'Install CSS::Sass, CSS::Minifier::XS, and'
. ' Mojolicious::Plugin::AssetPack to enable SASS processor'
app->log->debug( 'Install Mojolicious::Plugin::AssetPack to enable SASS'
. ' processor. You will also need CSS::Sass module or have `sass`'
. ' command working'
);
}

Expand Down

0 comments on commit 385a25a

Please sign in to comment.