Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
::AssetPack is needed only when processing SASS
  • Loading branch information
zoffixznet committed Jun 29, 2016
1 parent da20477 commit 3029914
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -153,7 +153,7 @@ install this now:

$ cpanm -vn Mojolicious

If you also plan on modifying the stylesheets, install these modules to
If you also plan on modifying the SASS stylesheets, install these modules to
enable SASS processor:

$ cpanm -vn CSS::Minifier::XS CSS::Sass Mojolicious::Plugin::AssetPack
Expand Down
14 changes: 10 additions & 4 deletions app.pl
Expand Up @@ -3,12 +3,18 @@
use File::Spec::Functions 'catfile';
use Mojolicious 6.58;
use Mojolicious::Lite;
use Mojolicious::Plugin::AssetPack 1.15;
use Mojo::Util qw/spurt/;

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

if ( eval { require CSS::Sass; require CSS::Minifier::XS; 1; } ) {
my $has_extra_modules = eval {
require CSS::Sass;
require CSS::Minifier::XS;
require Mojolicious::Plugin::AssetPack;
1;
};

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

Expand All @@ -21,8 +27,8 @@
app->log->debug('...Done');
}
else {
app->log->debug(
'Install CSS::Sass and CSS::Minifier::XS to enable SASS processor'
app->log->debug( 'Install CSS::Sass, CSS::Minifier::XS, and'
. ' Mojolicious::Plugin::AssetPack to enable SASS processor'
);
}

Expand Down

0 comments on commit 3029914

Please sign in to comment.