Skip to content

Commit

Permalink
Add package definition for sass.js
Browse files Browse the repository at this point in the history
  • Loading branch information
gdmayle committed Apr 15, 2012
1 parent ca5990f commit 7215a78
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions admin/generate-dev-bundle.sh
Expand Up @@ -138,6 +138,7 @@ npm install fibers@0.6.4
npm install useragent@1.0.5
npm install request@2.9.3
npm install http-proxy@0.8.0
npm install sass@0.5.0

# unused, but kept in bundle for compatibility for a while.
npm install connect-gzip@0.1.5
Expand Down
22 changes: 22 additions & 0 deletions packages/sass-js/package.js
@@ -0,0 +1,22 @@
Package.describe({
summary: "JavaScript implementation of Sass"
});

var sass = require('sass');
var fs = require('fs');

Package.register_extension(
"sass", function (bundle, source_path, serve_path, where) {
serve_path = serve_path + '.css';

var contents = fs.readFileSync(source_path);
contents = new Buffer(sass.render(contents.toString('utf8')));

bundle.add_resource({
type: "css",
path: serve_path,
data: contents,
where: where
});
}
);

1 comment on commit 7215a78

@jimsynz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice nice nice!

Please sign in to comment.