lodash-template-source-loader

1.0.0 • Public • Published

lodash-template-source-loader

Compile a lodash template and load its source. I can't believe this didn't already exist.

Usage

webpack.config.js:

module.exports = {
  module: {
    // ...
    rules: [
      // ...
      {
        test: /\.html$/,
        use: 'lodash-template-loader',
      }
    ],
  },
};

index.js:

import template from './index.html';

// <div>bar</div>
template({ foo: 'bar' });

index.html:

<div><%- obj.foo -%></div>

Package Sidebar

Install

npm i lodash-template-source-loader

Weekly Downloads

2

Version

1.0.0

License

Unlicense

Last publish

Collaborators

  • psirenny