esbuild-plugin-cleanup
v1.0.0
Published
By deleting the out folder before each new build, the plugin ensures a clean output directory for the build process.
Downloads
79
Maintainers
Readme
esbuild plugin cleanup
By deleting the out folder before each new build, the plugin ensures a clean output directory for the build process.
- Supports newest esbuild version
- Uses esbuild config to determine the out folder
- Type declarations (d.ts) included
How It Works
- esbuild calls this package in the onStart lifecycle.
- Gets the configuration from esbuild or user-defined configuration.
- Evaluate the out folder, that should be deleted, based on the given input.
- Deletes the evaluated out folder recursively.
Options
Overriding the out-folder
This package will use the esbuild out-file, out-folder and/or out-base as path to delete. Otherwise it may be helpful to overwrite this path manually:
cleanupPlugin(
overrideOut?: string | undefined
);
Usage
Installation
The plugin can be installed by any package manager.
npm
npm install esbuild-plugin-cleanup
yarn
yarn install esbuild-plugin-cleanup
pnpm
pnpm install esbuild-plugin-cleanup
Integration
The easy way to integrate this plugin in esbuild.
await esbuild.build({
plugins: [
cleanupPlugin(...)
]
})
See here for more about the esbuild plugin integration.
License
The MIT License (MIT) - Please have a look at the LICENSE file for more details.
Contributing
Feel free to contribute to this project.
You can fork this project and create a new pull request for contributing.
Get to the repository at GitHub.
GitHub @simonkovtyk