Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #21 from dboskovic/master
Browse files Browse the repository at this point in the history
Add preCompile option
  • Loading branch information
paulmillr committed Feb 17, 2014
2 parents e1608e4 + 953f58b commit e42dea3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ JadeCompiler.prototype.compile = function(data, path, callback) {
// cloning is mandatory because Jade changes it
options = clone(this.options);
options.filename = path;
compiled = jade.compileClient(data, options);
if(options.preCompile === true) {
compiled = jade.compile(data,options)();
compiled = JSON.stringify(compiled);
} else {
compiled = jade.compileClient(data, options);
}
return result = umd(compiled);
} catch (_error) {
error = _error;
Expand Down

0 comments on commit e42dea3

Please sign in to comment.