🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

broccoli-lodash-precompile

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-lodash-precompile

broccoli-lodash-precompile will, as its name states, precompile your templates with lodash and output them wrapped inside ES6 modules.

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

broccoli-lodash-precompile

broccoli-lodash-precompile will, as its name states, precompile your templates with lodash and output them wrapped inside ES6 modules.

Usage

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`
});

Options

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.

Keywords

broccoli-plugin

FAQs

Package last updated on 06 Mar 2015

Did you know?

Socket

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.

Install

Related posts