Skip to content
Browse files

Merge pull request #94 from andrewplummer/master

Monkey patching ender.closure.js to handle externs files
  • Loading branch information...
2 parents 368f5d1 + 332d048 commit 14af8eed90254c8b1ebe470f41def0ecc16289f7 @ded ded committed
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/ender.closure.js
View
10 lib/ender.closure.js
@@ -4,9 +4,17 @@ var process = require('child_process')
, CLOSURE = {
compile: function (files, use, callback) {
+ var nextIsExterns = false;
use = use || "ender"
files.unshift(use + '.js');
files = files.map(function (file) {
+ if(file == '--externs') {
+ nextIsExterns = true;
+ return '';
+ } else if(nextIsExterns) {
+ nextIsExterns = false;
+ return '--externs=' + file;
+ }
return '--js=' + file;
}).join(' ');
var jar = path.join(__dirname, '../support/closure.jar');
@@ -17,4 +25,4 @@ var process = require('child_process')
}
};
-module.exports = CLOSURE;
+module.exports = CLOSURE;

0 comments on commit 14af8ee

Please sign in to comment.
Something went wrong with that request. Please try again.