Skip to content

Commit

Permalink
Use global jade instead of window.jade
Browse files Browse the repository at this point in the history
Closes #727
  • Loading branch information
Rowno committed Feb 10, 2013
1 parent 608ddd0 commit 3b6052f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions support/compile.js
@@ -1,4 +1,3 @@

/**
* Module dependencies.
*/
Expand Down Expand Up @@ -88,7 +87,7 @@ function parseConditionals(js) {

function compile() {
var buf = '';
buf += '(function() {\n';
buf += 'var jade = (function() {\n';
buf += '\n// CommonJS require()\n\n';
buf += browser.require + '\n\n';
buf += 'require.modules = {};\n\n';
Expand All @@ -102,7 +101,7 @@ function compile() {
buf += js;
buf += '\n}); // module: ' + file + '\n';
});
buf += '\nwindow.jade = require("jade");\n';
buf += '\nreturn require("jade");\n';
buf += '})();\n';
fs.writeFile('jade.js', buf, function(err){
if (err) throw err;
Expand Down Expand Up @@ -173,4 +172,4 @@ var browser = {
register: function(path, fn){
require.modules[path] = fn;
}
};
};

0 comments on commit 3b6052f

Please sign in to comment.