https://github.com/inqnuam/esbuild-plugin-handlebars
an esbuild plugin to handle ... handlebars!
https://github.com/inqnuam/esbuild-plugin-handlebars
Last synced: 3 months ago
JSON representation
an esbuild plugin to handle ... handlebars!
- Host: GitHub
- URL: https://github.com/inqnuam/esbuild-plugin-handlebars
- Owner: Inqnuam
- Created: 2022-09-23T21:30:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-27T20:12:17.000Z (about 1 year ago)
- Last Synced: 2025-03-02T05:03:53.253Z (3 months ago)
- Language: TypeScript
- Size: 15.6 KB
- Stars: 4
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# esbuild-plugin-handlebars
> an [esbuild](https://github.com/evanw/esbuild) plugin to handle ... handlebars!
## Installation
```bash
yarn add -D esbuild-plugin-handlebars
# or
npm install -D esbuild-plugin-handlebars
```## Usage
```js
const esbuild = require("esbuild");
const handlebarsPlugin = require("esbuild-plugin-handlebars");esbuild
.build({
entryPoints: ["input.js"],
outfile: "output.js",
bundle: true,
plugins: [handlebarsPlugin()],
})
.then((result) => console.log(result))
.catch(() => process.exit(1));
```You can also set additionalHelpers and precompileOptions:
```js
const hbsOptions = {
additionalHelpers: {},
additionalPartials: {
childTemplate: "./child.hbs",
},
precompileOptions: {},
};// usual esbuild config
{
...
plugins: [handlebarsPlugin(hbsOptions)],
...
}```