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

ESBuild plugin for cleaning up assets before building.

  • 0.1.1-0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19K
increased by21.63%
Maintainers
1
Weekly downloads
 
Created
Source

esbuild-plugin-clean

ESBuild plugin for cleaning up output/assets before building.

Usage

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.

npm i esbuild-plugin-clean -D
pnpm i esbuild-plugin-clean -D
yarn add esbuild-plugin-clean -D
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 under the hood, so you can easily pass del options to plugin.

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';
}

Keywords

FAQs

Package last updated on 16 May 2021

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

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