Skip to content

andreisergiu98/esbuild-plugin-commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Name Type Description
onSuccess string Command to run after build is succesful
onError string Command to run if the build fails

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published