Created
June 18, 2014 06:44
-
-
Save ama-ch/c2bd6368608b9b8782f3 to your computer and use it in GitHub Desktop.
fixclosureでignoreされたprovideを無視しない
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getProvideRequireSrc(buf, info) { | |
var toProvide = info.toProvide.map(function(namespace) { | |
/*jshint quotmark:false */ | |
return "goog.provide('" + namespace + "');"; | |
}); | |
var ignoredProvide = info.ignoredProvide.map(function(namespace) { | |
/*jshint quotmark:false */ | |
return "goog.provide('" + namespace + "'); // fixclosure: ignore"; | |
}); | |
var allToProvide = toProvide.concat(ignoredProvide).sort(); | |
allToProvide.forEach(function(provide) { | |
buf.push(provide); | |
}); | |
var toRequire = info.toRequire.map(function(namespace) { | |
/*jshint quotmark:false */ | |
return "goog.require('" + namespace + "');"; | |
}); | |
var ignoredRequire = info.ignoredRequire.map(function(namespace) { | |
/*jshint quotmark:false */ | |
return "goog.require('" + namespace + "'); // fixclosure: ignore"; | |
}); | |
if (allToProvide.length > 0 && toRequire.length + ignoredRequire.length > 0) { | |
buf.push(''); | |
} | |
toRequire.concat(ignoredRequire).sort().forEach(function(req) { | |
buf.push(req); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment