Babel plugin to replace tagged template strings or function calls with precompiled HTMLBars templates, primarily used in Ember.js applications. Current stable version is 5.3.1, released on a monthly cadence. Key differentiator: it allows inline HBS templates in tests and code, which get precompiled at build time. Alternative to ember-cli-htmlbars for non-Ember projects, but tightly coupled to Ember's template compiler. Requires Node 10+, Ember 2.10+, and Babel 7. Notable breaking change in v5.0.0: renamed `scope` option to `locals`.
npm install babel-plugin-htmlbars-inline-precompileVerified import paths — ran on the pinned version, not inferred.
Shows Babel plugin setup and usage of hbs tagged template for inline compiled templates.
Replace any usage of `scope` with `locals` in plugin options.
Upgrade to Babel 7 and use babel-plugin-htmlbars-inline-precompile >=3.0.0.
Use ESM imports. If using CommonJS, write `const hbs = require('htmlbars-inline-precompile').default`.Use `templateCompilerPath` option to specify path to template compiler.
Run `npm install --save-dev babel-plugin-htmlbars-inline-precompile`.
Ensure you pass a valid precompile function, e.g., from @glimmer/compiler: `precompile: require('@glimmer/compiler').precompile`.Ensure the Babel plugin is configured correctly and that code with hbs is being transpiled by Babel.
No dependency data recorded yet.