postal.js/node_modules/anvil.js/next/lib/compiler.min.js
2012-08-28 12:06:19 -04:00

1 line
No EOL
595 B
JavaScript

var compilerFactory=function(a,b,c){var d=function(){this.extensionMap={},this.compilers={}};return d.prototype.registerCompiler=function(a,b,c){this.extensionMap[a]=b,this.compilers[a]=c},d.prototype.compile=function(a,d){var e=a.ext(),f=this.extensionMap[e],g=a.name.replace(e,f),h=this.compilers[e];h&&f?(c.onDebug("Compiling "+a.name+" to "+g),b.transform([a.workingPath,a.name],h,[a.workingPath,g],function(b){b?(c.onError("Error compiling "+a.name+": \r\n "+b),d(a,b)):(a.name=g,d(a))})):(c.onWarning("No compilers registered for files of type "+e),d(a))},d};module.exports=compilerFactory