Last active
August 29, 2015 14:05
-
-
Save oroce/a10a8173f4dbe2fbbe9f to your computer and use it in GitHub Desktop.
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 fs = require('fs'); | |
| var jade = require('jade'); | |
| require.extensions['.jade'] = function(module, data) { | |
| var content = fs.readFileSync(module.filename); | |
| var str = 'module.exports = ' + jade.compile(content, {filename: module.filename}); | |
| console.log(module.filename, str); | |
| return module._compile(str, data); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And the function above is not going to get a string but an object that has a filename property.