You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use this plugin to create a single downloadable template file from many different pug files, it adds the following line to the top of your template file:
var pug = pug || require('pug/lib/runtime');
That file no longer exists in the main pug package, and when combined with #169, that pretty much means you're screwed since your template file will attempt to reference a non-existent file.
This should be changed to require pug-runtime instead.
The text was updated successfully, but these errors were encountered:
I'm not sure when it changed, but I set up a project using grunt-contrib-pug within the past week, and found that this was the case using the latest version of pug from NPM.
Here's the (CoffeeScript) config I used which produced the problem:
pug:pages:templates:options:client:truecompileDebug:falsenode:truepretty:falseinlineRuntimeFunctions:falseprocessName: (f)->f=f.replace DIR_SRC_VIEWS, ""f=f.replace/^\/[^\/]+\/([^.]+)\.pug$/ , "$1"return f
files:"#{DIR_SRC_VIEWS}/templates.js": ["#{DIR_SRC_VIEWS}/**/*.pug"]
Running this shell script on the output template file makes everything work as expected:
sed -i '''s/pug\/lib\/runtime/pug-runtime/'"$TEMPLATE_FILE"
If you use this plugin to create a single downloadable template file from many different pug files, it adds the following line to the top of your template file:
That file no longer exists in the main
pug
package, and when combined with #169, that pretty much means you're screwed since your template file will attempt to reference a non-existent file.This should be changed to require
pug-runtime
instead.The text was updated successfully, but these errors were encountered: