Update to API v0.1
diff --git a/lib/Mojolicious/Plugin/AssetPack/LibSass.pm b/lib/Mojolicious/Plugin/AssetPack/LibSass.pm
new file mode 100644
index 0000000..6a082a4
--- /dev/null
+++ b/lib/Mojolicious/Plugin/AssetPack/LibSass.pm
@@ -0,0 +1,27 @@
+package Mojolicious::Plugin::AssetPack::LibSass;
+use Mojo::Base 'Mojolicious::Plugin';
+use CSS::Sass;
+use CSS::Minifier::XS;
+
+sub register {
+ my ($plugin, $mojo) = @_;
+
+ my $sass = CSS::Sass->new;
+
+ # Todo: Check if AssetPack is loaded
+ # Todo: Only minify if necessary
+
+ my $proc = $mojo->asset->preprocessors;
+
+ $proc->remove('scss');
+ $proc->add(
+ scss => sub {
+ my ($as, $text, $file) = @_;
+ $$text = CSS::Minifier::XS::minify($sass->compile($$text));
+ });
+ $proc->map_type(scss => 'css');
+};
+
+1;
+
+__END__