Skip to content

Commit 3029914

Browse files
committed
::AssetPack is needed only when processing SASS
1 parent da20477 commit 3029914

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ install this now:
153153

154154
$ cpanm -vn Mojolicious
155155

156-
If you also plan on modifying the stylesheets, install these modules to
156+
If you also plan on modifying the SASS stylesheets, install these modules to
157157
enable SASS processor:
158158

159159
$ cpanm -vn CSS::Minifier::XS CSS::Sass Mojolicious::Plugin::AssetPack

app.pl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
use File::Spec::Functions 'catfile';
44
use Mojolicious 6.58;
55
use Mojolicious::Lite;
6-
use Mojolicious::Plugin::AssetPack 1.15;
76
use Mojo::Util qw/spurt/;
87

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

11-
if ( eval { require CSS::Sass; require CSS::Minifier::XS; 1; } ) {
10+
my $has_extra_modules = eval {
11+
require CSS::Sass;
12+
require CSS::Minifier::XS;
13+
require Mojolicious::Plugin::AssetPack;
14+
1;
15+
};
16+
17+
if ( $has_extra_modules ) {
1218
plugin AssetPack => { pipes => [qw/Sass JavaScript Combine/] };
1319
app->asset->process('app.css' => 'sass/style.scss' );
1420

@@ -21,8 +27,8 @@
2127
app->log->debug('...Done');
2228
}
2329
else {
24-
app->log->debug(
25-
'Install CSS::Sass and CSS::Minifier::XS to enable SASS processor'
30+
app->log->debug( 'Install CSS::Sass, CSS::Minifier::XS, and'
31+
. ' Mojolicious::Plugin::AssetPack to enable SASS processor'
2632
);
2733
}
2834

0 commit comments

Comments
 (0)