Permalink
Browse files

Use global `jade` instead of `window.jade`

Closes #727
  • Loading branch information...
1 parent 608ddd0 commit 3b6052fa88afd8726c8f94253c28359c5045b18d @Rowno Rowno committed Feb 10, 2013
Showing with 3 additions and 4 deletions.
  1. +3 −4 support/compile.js
View
@@ -1,4 +1,3 @@
-
/**
* Module dependencies.
*/
@@ -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';
@@ -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;
@@ -173,4 +172,4 @@ var browser = {
register: function(path, fn){
require.modules[path] = fn;
}
-};
+};

0 comments on commit 3b6052f

Please sign in to comment.