Closed rwjblue closed 9 years ago
@mmun suggested that we should not hijack loc.source
for a non-absolute file path (and I agree). Will be updating shortly...
Completely refactored based on @mmun's feedback. Now it accepts a buildMeta
callback function in options, and puts all information in meta
on the template object.
Updated, to pass the program
through to the buildMeta
callback and remove loc
from default meta
.
Updated to remove some string gymnastics from the TemplateCompiler (rely on JSON.stringify
for that).
:heart:
Adds
buildMeta
callback tocompile
options.If a
buildMeta
function is present in the options passed tocompile
orcompileSpec
, the return value will be used for themeta
key in the template output.This allows the host frameworks compiler to add metadata details (moduleName, revision, etc) as needed.
Sample template output (no buildMeta callback):
Sample output with a general
buildMeta
as Ember might use it: