1.1.0 • Published 10 months ago

esbuild-handlebars v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

esbuild-handlebars

fix Cannot read properties of undefined (reading 'call') issue

(Compatible with injection of custom methods for multi-layer nesting, the original github project)

an esbuild plugin to handle ... handlebars!

Installation

yarn add -D esbuild-handlebars
# or
npm install -D esbuild-handlebars

Usage

const hbsPlugin = require('esbuild-handlebars');
const path = require('path');

module.exports = [
    hbsPlugin({
		filter: /\.(hbs|handlebars)$/i,
        additionalHelpers: {
            equal: path.join(__dirname, '/helper/template/equal'),
        },
        precompileOptions: {}
    })
];

You can also set additionalHelpers and precompileOptions:

const hbsOptions = {
        additionalHelpers: {},
        additionalPartials: {},
        precompileOptions: {}
      }

// usual esbuild config
{
 ...
 plugins: [handlebarsPlugin(hbsOptions)],
 ...
}
1.1.0

10 months ago

1.0.1

10 months ago