Last active
August 29, 2015 14:16
-
-
Save asbjornenge/e82c9867ae0d7344808f to your computer and use it in GitHub Desktop.
Stylus browserify transform 🚀
This file contains hidden or 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 transformTools = require('browserify-transform-tools') | |
var stylus = require('stylus') | |
module.exports = transformTools.makeStringTransform( | |
"stylusify", | |
{ | |
includeExtensions: [".styl"] | |
}, | |
function (content, opts, done) { | |
stylus(content).render(function(err, css) { | |
if (err) { return done(err) } | |
console.log(typeof css) | |
return done(null, 'module.exports="'+css.replace(/\n/g,'')+'"') | |
}) | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment