{"library":"lodash-template-webpack-loader","title":"lodash-template-webpack-loader","description":"Webpack loader that compiles Lodash/Underscore templates into functions. Version 1.0.2, stable, last updated 2016. Supports interpolation (<%= %>), escape (<%- %>), evaluation (<% %>), template settings (imports, variable, custom delimiters), and optional global or engine-based Lodash. Notable for its simplicity and customizability without bundling full Lodash unless desired. No known active development or maintenance.","language":"javascript","status":"maintenance","last_verified":"Sat Apr 25","install":{"commands":["npm install lodash-template-webpack-loader"],"cli":null},"imports":["module.exports = { module: { loaders: [{ test: /\\.tpl$/, loader: 'lodash-template-webpack' }] } }"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// webpack.config.js\nconst path = require('path');\nmodule.exports = {\n  entry: './src/index.js',\n  output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist') },\n  module: {\n    loaders: [\n      { test: /\\.tpl$/, loader: 'lodash-template-webpack' }\n    ]\n  },\n  lodashTemplateLoader: {\n    engine: 'lodash',\n    importsModule: path.join(__dirname, 'template-imports')\n  }\n};\n\n// template-imports.js\nmodule.exports = {\n  scream: function(str) { return (str || '').toUpperCase(); }\n};\n\n// src/index.js\nvar template = require('./template.tpl');\ndocument.body.innerHTML = template({ title: 'Hello' });\n\n// template.tpl\n<h1><%= title %></h1>\n<p><%- scream('hello') %></p>","lang":"javascript","description":"Shows webpack config, template imports module, and usage in a JS file with Lodash template syntax.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}