1.1.0 • Published 2 years ago

esbuild-plugin-commands v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

esbuild-plugin-commands

This is a plugin for esbuild that runs commands after the build succeeded or failed and also makes sure to kill previous processes everytime.

It is particulary useful to restart the app after build.

Usage

Install esbuild and the plugin

npm install -D esbuild
npm install -D esbuild-plugin-commands

Set up a build script

import { build } from 'esbuild';
import { esbuildCommands } from 'esbuild-plugin-commands';

await build({
	entryPoints: ['index.js'],
	outdir: 'dist',
	platform: 'node',
	target: 'node14',
	bundle: true,
	sourcemap: 'external',
	watch: true,
	plugins: [esbuildCommands({ onSuccess: 'node --inspect dist/index.js' })],
});

Run your builder.

Screenshot

Screenshot


Options

NameTypeDescription
onSuccessstringCommand to run after build is succesful
onErrorstringCommand to run if the build fails
1.1.0

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago