Created
June 18, 2012 14:34
-
-
Save deedubs/2948668 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 browserify = require('browserify') | |
, jade = require('jade') | |
, config = require('../config') | |
, bundle = browserify({ | |
mount: '/app.js' | |
, require : { jquery: 'jquery-browserify', backbone: 'backbone-browserify' } | |
, watch: true | |
, debug: true | |
}); | |
bundle.register('.jade', function (body) { | |
var options = {"client": true, "compileDebug": false}; | |
body = "module.exports = " + jade.compile(body, options).toString() +";"; | |
return body; | |
}); | |
bundle.addEntry(config.root + '/app/js/index.js'); | |
var jaderuntime = require('fs').readFileSync(config.root + "/node_modules/jade/runtime.js", 'utf8'); | |
bundle.prepend(jaderuntime); | |
module.exports = function(app) { | |
app.use(bundle); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment