Created
May 29, 2014 21:32
-
-
Save lvivier/89b198a2f7b9dac39a2b to your computer and use it in GitHub Desktop.
A stupid Stylus plugin for component/builder2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stylus = require('stylus') | |
module.exports = function (opts) { | |
return function (file, done) { | |
if (file.extension !== 'styl') return done() | |
file.read(function (err, str) { | |
if (err) return done(err) | |
stylus(str, opts) | |
.set('filename', file.filename) | |
.render(function(err, css) { | |
if (err) return done(err) | |
file.extension = 'css' | |
file.string = css | |
done() | |
}) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment