Babel plugin implementing Ember's low-level template compilation API. Current stable version is 4.0.0 (released 2026-01-13). Maintained by the Ember core team. It handles compiling Ember handlebars templates into JavaScript functions during Babel transpilation. Key differentiator: it is the official, modern way to precompile Ember templates in build pipelines (Embroider, classic builds). Breaking changes: v3.0.0 converted to ESM-only and dropped Node <18; v4.0.0 avoids leaking real filename paths in output. Release cadence: major/minor every few months.
npm install babel-plugin-ember-template-compilationVerified import paths — ran on the pinned version, not inferred.
Configures Babel to compile Ember template strings (via hbs) using the wire format and @glimmer/compiler.
Update to Node >=18, and ensure your Babel config or bundler handles ESM. If using require(), switch to import.
If you relied on the real path in moduleName, configure it explicitly using the 'moduleName' option in the plugin.
Use option key 'outputFormat' (not 'format'). Valid values: 'wire', 'hbs', 'hbs-loose'.
Prefer 'targetFormat' when using v3+. Check documentation for mapping.
Upgrade to >=2.4.1 to get correct this binding.
Run: npm install --save-dev @glimmer/compiler
Use import plugin from 'babel-plugin-ember-template-compilation' or update Babel config to use import.
Add moduleName: false if you don't want filenames, or set it to a string.