{"library":"rollup-plugin-handlebars-precompiler","title":"rollup-plugin-handlebars-precompiler","description":"Rollup plugin that precompiles Handlebars templates into ES modules. Version 1.0.2 requires Node >=18 and Handlebars as a peer dependency. Generates ESM-only modules with TypeScript support, automatic partial detection, source maps, and convenient DOM integration via exported RawTemplate and Template functions. Unlike other Handlebars rollup plugins, it outputs DocumentFragment-ready modules with type definitions.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-handlebars-precompiler"],"cli":null},"imports":["import handlebarsPrecompiler from 'rollup-plugin-handlebars-precompiler'","import Template, { RawTemplate } from './template.hbs'","import { RawTemplate } from './template.hbs'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// rollup.config.js\nimport handlebarsPrecompiler from 'rollup-plugin-handlebars-precompiler'\n\nexport default {\n  input: 'src/main.js',\n  output: { dir: 'dist', format: 'esm' },\n  plugins: [\n    handlebarsPrecompiler({\n      // Include handlebars helpers from a specific file\n      helpers: 'src/helpers/**/*.js',\n      // enable source maps\n      sourceMap: true\n    })\n  ]\n}\n\n// src/main.js\nimport Template from './component.hbs'\n\nconst app = document.getElementById('app')\nconst context = { message: 'Hello' }\napp.appendChild(Template(context))","lang":"javascript","description":"Shows rollup config with plugin setup and usage of imported Handlebars template to append a DocumentFragment to the DOM.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}