I'd like to use some lodash functions to help prepare some data in the beforeRender() helper function. But I can't seem to get it to load via var _ = require('lodash'). I added it to the allowedModules array, and installed it in the main jsreport directory. I can use it in functions defined here:
/jsreport/templates/CDL/helpers.js
but not here, where it seems beforeRender() must be defined:
/jsreport/data/scripts/CDL/content.js
I tried moving the definition of beforeRender() to /jsreport/templates/CDL/helpers.js but then the whole thing times out. I'm presuming the beforeRender() function must be defined in the other location - still learning though, and not sure what the differences are in context and execution order!
Simple question - is it possible to use external libraries like lodash in /jsreport/data/scripts/CDL/content.js?