Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

underscore-loader

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

underscore-loader

Webpack loader for pre-compiled Underscore/Lodash templates with HTML minification

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
118
decreased by-45.62%
Maintainers
1
Weekly downloads
 
Created
Source

underscore-loader

Webpack loader for pre-compiled Underscore/Lodash templates with HTML minification

  • template is compliled with lodash.template
  • template are minified by html-minifier

Installation

$ npm install --save underscore-loader lodash.escape

Important!!1

For webpack 1.x.x use version 2.0.0

Options (defaults)

Webpack (2.x.x) config

{
  // ...
 module: {
    rules: [
      {
        test: /\.tpl$/,
        loader: 'underscore-loader',
        options: {
          engine: 'var _ = { escape: require(\'lodash.escape\') };\n',
          minifierOptions: { collapseInlineTagWhitespace: true }
        }
      }
    ]
  }
  // ..
}

engine

  • for full lodash set it to var _ = require(\'lodash\');
  • for full underscore set it to var _ = require(\'underscore\');
  • lodash.escape is default, change it to lodash, underscore or some-other-engine

minify

minifierOptions

originalSource

  • append original html in comment

templateOptions

Setting template engine

  • set underscore/lodash/other-module dependency in package.json
  • if you don't use any logic in your templates, you can pass empty string (engine: '')

Custom module's path examples (old README)

View on github.

Changelog

View on github.

Keywords

FAQs

Package last updated on 04 Apr 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc