A Handlebars template loader for Webpack. Current stable version is 1.1.0 (last updated 2024). It allows you to require .hbs files and use them as compiled templates, with support for helpers, partials, macros, and image loading. Key differentiators: includes macros like require, include, repeat; options for prepending filename comment for debugging; supports custom Handlebars runtime path. Release cadence is low, with infrequent updates. Note: does not bundle Handlebars, so you must install it separately.
npm install handlebars-template-loaderVerified import paths — ran on the pinned version, not inferred.
Sets up the loader in webpack config and shows a basic template compilation and rendering.
Use webpack 4. For older webpack versions, use version 0.x.
Run 'npm install handlebars --save' in your project.
Add 'node: { fs: "empty" }' to webpack config.Set 'query: { root: __dirname }' or use relative paths.Run 'npm install handlebars'
Add 'node: { fs: "empty" }' to webpack config.Use 'const Handlebars = require('handlebars-template-loader/runtime')'