mirror of
https://github.com/Hopiu/postal.js.git
synced 2026-04-12 19:11:05 +00:00
1 line
No EOL
595 B
JavaScript
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 |