Open sanojian opened 8 years ago
It seems that the issue is that somehow the "inlineRuntimeFunctions" option of pug-code-gen is getting set to true by default. If I set this option to false it no longer generates extra code that breaks the parsing.
To add to this, options.inlineRuntimeFunctions
is also breaking the output when options.namespace
is set to a truthy value. This is the output it generates:
this['Namespace']['fileName'] = function pug_escape(e){...};
function template(locals){...}
To get around this you need to manually set options.inlineRuntimeFunctions
to false and include pug-runtime
with your template functions.
By default, compileDebug option is true and invalid output is generated. A "pug_rethrow" function is inserted into the code and it will not parse.
Setting "compileDebug: false" is a workaround to get around this problem until it is fixed.