{"library":"rollup-plugin-hbs","title":"rollup-plugin-hbs","description":"A minimal Rollup plugin for bundling Handlebars templates. Version 1.2.6 is the latest stable release, last updated in 2020. It compiles .hbs (or custom extension) templates into precompiled JavaScript functions, integrating with Handlebars runtime. Compared to other Handlebars Rollup plugins like rollup-plugin-handlebars-plus, this package offers a simpler API, sourcemap support, partial detection based on filename prefix, and whitespace optimization. It requires Handlebars, Rollup >=0.62.0, and rollup-pluginutils as peer dependencies. Note that the plugin has not been updated for Rollup 2+/3+ and may be incompatible with modern Rollup versions; consider using @rollup/plugin-handlebars instead.","language":"javascript","status":"deprecated","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-hbs"],"cli":null},"imports":["import hbs from 'rollup-plugin-hbs'","import hbs from 'rollup-plugin-hbs'","import Handlebars from 'handlebars'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// rollup.config.js\nimport hbs from 'rollup-plugin-hbs';\nimport resolve from '@rollup/plugin-node-resolve';\nimport commonjs from '@rollup/plugin-commonjs';\n\nexport default {\n  input: 'src/main.js',\n  output: { file: 'bundle.js', format: 'iife' },\n  plugins: [\n    resolve(),\n    commonjs(),\n    hbs({\n      handlebars: {\n        id: 'handlebars',\n        options: { sourceMap: true },\n        optimize: true\n      },\n      templateExtension: '.hbs',\n      isPartial: (name) => name.startsWith('_')\n    })\n  ]\n};\n\n// src/main.js\nimport template from './template.hbs';\nconst html = template({ name: 'world' });\nconsole.log(html);\n\n// src/template.hbs\n<p>Hello {{name}}!</p>","lang":"javascript","description":"Configures Rollup to compile Handlebars templates, importing a template and rendering it with data.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}