Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Encapsulate client-side Jade to make it play nice with RequireJS. #344

Merged
merged 1 commit into from

3 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  support/compile.js
View
3  support/compile.js
@@ -88,6 +88,7 @@ function parseConditionals(js) {
function compile() {
var buf = '';
+ buf += '(function() {\n';
buf += '\n// CommonJS require()\n\n';
buf += browser.require + '\n\n';
buf += 'require.modules = {};\n\n';
@@ -101,6 +102,8 @@ function compile() {
buf += js;
buf += '\n}); // module: ' + file + '\n';
});
+ buf += '\nwindow.jade = require("jade");\n';
+ buf += '})();\n';
fs.writeFile('jade.js', buf, function(err){
if (err) throw err;
console.log(' \033[90m create : \033[0m\033[36m%s\033[0m', 'jade.js');
Something went wrong with that request. Please try again.