
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
broccoli-lodash-precompile
Advanced tools
broccoli-lodash-precompile will, as its name states, precompile your templates with lodash and output them wrapped inside ES6 modules.
broccoli-lodash-precompile will, as its name states, precompile your templates with lodash and output them wrapped inside ES6 modules.
The following example will take all files with the .html extension inside input-tree and compile them to JS.
// Brocfile.js
var templatePrecompile = require('broccoli-lodash-precompile');
module.exports = templatePrecompile('templates', {
dataObjectVariable: 'data', // Defaults to 'locals'
useLodashEscape: false // Defaults to `true`
});
localsVariableName
By default lodash uses with to create a context inside your templates, but since ES6 modules are in strict mode and with is prohibited in strict mode, we have to specify a variable where all locals will be defined.
useLodashEscape
Lodash templates depend on _.escape being globally defined and sometimes you don’t want that. So setting this option to false will use a local variable inside each template. Note that this is our own implementation of escape instead of lodash’s but at the time of this writing, they’re pretty similar.
FAQs
broccoli-lodash-precompile will, as its name states, precompile your templates with lodash and output them wrapped inside ES6 modules.
We found that broccoli-lodash-precompile demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.