Closed umairsiddique closed 11 years ago
If you are able to add support for issue #11, then we can also have a method for adding template compilers.
module.exports.compilers = compilers = template: (name, compiler, namespace = "TEMPLATES") -> match: /\.js$/ namespace: namespace compileSync: (sourcePath, source, assetName) -> "(function() { window.#{@namespace} = window.#{@namespace} || {}; window.#{@namespace}['#{assetName}'] = #{compiler(source, assetName, sourcePath)}; })();" coffee: match: /\.js$/ compileSync: (sourcePath, source, assetName) -> CoffeeScript.compile source, {filename: sourcePath}
Then we would be able to add new template compilers like so.
snockets.compilers.template 'mustache', (source) -> Hogan.compile(source, asString: true)
or
connectAssets.jsCompilers.template 'mustache', (source) -> Hogan.compile(source, asString: true)
I like the idea. I'll consider this in some form or another for the next release.
If you are able to add support for issue #11, then we can also have a method for adding template compilers.
Then we would be able to add new template compilers like so.
or