🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
DemoInstallSign in
Socket

esbuild-plugin-hbs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-hbs

`esbuild-plugin-hbs` is a plugin to generate HTML files through handlebars with [esbuild](https://esbuild.github.io).

0.0.3
latest
npm
Version published
Weekly downloads
118
28.26%
Maintainers
1
Weekly downloads
 
Created
Source

esbuild-plugin-hbs is a plugin to generate HTML files through handlebars with esbuild.

Is anything missing, please please create a ticket

Requirements

...

Installation

yarn add -D esbuild-plugin-hbs
# or
npm i --save-dev esbuild-plugin-hbs

Usage

You can set options in separate json files.

Some helpers are included out of the box. I will keep adding to the list.

You can use the json helper like the following code to debug your data.

{{ json user }}

Under the hood esbuild-plugin-hbs uses the jsdom lib.

⚠️ This plugin tries to cover most cases, set as much as possible with little configuration. If you find that I have forgotten certain issues, please write a ticket

Sample configuration

const options: {
	entryPoints: ['index.ts'],
	bundle: true,
	metafile: true,
	outdir: 'dist/',
	plugins: [
		handlebarsPlugin({
			views: 'views',
			html: 'html',
			public: 'public',
			files: [
				{
					filename: 'single.hbs',
					title: 'This is the Single file',
					data: './single.json',
				},
				{
					filename: 'about.html',
					title: 'This is the about file',
					data: './user.json',
				},
			]
		}),
	],
};

esbuild.build(options).catch(() => process.exit(1))

Sample json configuration

{
	"title": "This is the single page",
	"namespace": "single",
	"insertScript": true,
	"items": [{
		"id": 1,
		"first_name": "Kaila"
	}, {
		"id": 2,
		"first_name": "Barrie"
	}]
}

Contributing

Contributions are very welcome

Todos

Keywords

esbuild

FAQs

Package last updated on 12 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts