Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esbuild-plugin-clean

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-clean - npm Package Compare versions

Comparing version 0.0.2 to 0.1.1-0

2

package.json
{
"name": "esbuild-plugin-clean",
"version": "0.0.2",
"version": "0.1.1-0",
"description": "ESBuild plugin for cleaning up assets before building.",

@@ -5,0 +5,0 @@ "keywords": [

# esbuild-plugin-clean
This library was generated with [Nx](https://nx.dev).
ESBuild plugin for cleaning up output/assets before building.
## Running unit tests
## Usage
Run `nx test esbuild-plugin-clean` to execute the unit tests via [Jest](https://jestjs.io).
**Node: this plugin require ESBuild version ^0.11.19 for the `onStart`/`onEnd` hooks**
**GitHub Repository/Homepage is private for now, if you got any troubles, just open issue in this [repo](https://github.com/linbudu599/Blog).**
```bash
npm i esbuild-plugin-clean -D
pnpm i esbuild-plugin-clean -D
yarn add esbuild-plugin-clean -D
```
```typescript
import { build } from 'esbuild';
import clean from 'esbuild-plugin-clean';
(async () => {
const res1 = await build({
entryPoints: ['./demo.ts'],
bundle: true,
outfile: './dist/main.js',
plugins: [
clean({
patterns: ['./dist/*'],
}),
],
});
})();
```
## Configuration
This plugin use [del](https://www.npmjs.com/package/del) under the hood, so you can easily pass del options to plugin.
```typescript
export interface CleanOptions {
// del patterns
// default: []
patterns?: string | string[];
// use dry-run mode to have a try
// default: false
dryRun?: boolean;
// del options
// default: {}
options?: DelOptions;
// use del or del.sync for cleaning up
// default: true
sync?: boolean;
// do cleaning in start/end/both
// maybe in some strange cases you will need it ? :)
// default: "start"
cleanOn?: 'start' | 'end' | 'both';
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc