1.2.0 • Published 6 years ago

lodash-simple-template-loader v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

lodash-template-loader

Lodash template loader for Webpack.

This is tiny webpack loader which wraps lodash _.template() to render templates during webpack build. This loader outputs fully rendered string (HTML) without bundling lodash. Global data for templates (views) is passed using imports property of loader options object.

Other available options:

Install

$ npm i lodash-simple-template-loader --save

Usage

WebPack 2.x

module: {
    rules: [ {
        test: /\.html$/,
        use: [
            {
                loader: 'apply-loader'
            },
            {
                loader: 'lodash-simple-template-loader',
                options: {
                    imports: { // data object which will be passed to templates for rendering
                        title: 'Hello World!'
                    }
                }
            }
        ]
    } ]
}