{"library":"rollup-plugin-handlebars-plus","title":"rollup-plugin-handlebars-plus","description":"Rollup plugin to precompile and resolve Handlebars templates, including support for partials, helpers, and optional rendering to jQuery collections. Current stable version is 0.4.2 (2020-09-09). The plugin integrates with Rollup's module system, allowing import of .hbs templates as ES6 modules, and precompiles templates so only the Handlebars runtime is needed. Key differentiators: includes Handlebars runtime, supports partial roots with rollup-plugin-root-import, and can render to jQuery objects directly. Requires rollup-plugin-node-resolve and rollup-plugin-commonjs for runtime support. Maintenance status: appears unmaintained since last release in 2020, with known security issues in older Handlebars versions.","language":"javascript","status":"maintenance","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-handlebars-plus"],"cli":null},"imports":["import handlebars from 'rollup-plugin-handlebars-plus'","import { default as handlebars } from 'rollup-plugin-handlebars-plus'","import Template from './template.hbs'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// main.js\nimport handlebars from 'rollup-plugin-handlebars-plus';\nimport rootImport from 'rollup-plugin-root-import';\n\n// rollup.config.js\nexport default {\n  input: 'main.js',\n  plugins: [\n    rootImport({\n      root: [`${__dirname}/src/views`],\n    }),\n    handlebars({\n      handlebars: {\n        id: 'handlebars',\n      },\n      helpers: ['/utils/helpers.js'],\n      partialRoot: [`${__dirname}/src/views`],\n    }),\n  ],\n  output: {\n    format: 'esm',\n    file: 'bundle.js',\n  },\n};\n\n// template.hbs\n<h1>{{title}}</h1>\n\n// Use in main.js\nimport tmpl from './template.hbs';\ndocument.body.innerHTML = tmpl({title: 'Hello'});","lang":"javascript","description":"Shows a basic rollup config using the plugin, importing a .hbs template and rendering it.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}