Socket
Book a DemoInstallSign in
Socket

esbuild-clean-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-clean-plugin

An esbuild plugin to clean your build folder.

2.0.0
latest
npmnpm
Version published
Weekly downloads
9.4K
-12.92%
Maintainers
1
Weekly downloads
 
Created
Source

esbuild-clean-plugin

npm build

An esbuild plugin to clean your build folder.

Installation

npm install esbuild-clean-plugin

Requirements

  • Node 22.11.0 (LTS) or later.
  • esbuild 0.18.20 or later.

Usage

import * as esbuild from 'esbuild';
import { cleanPlugin } from 'esbuild-clean-plugin';
import path from 'path';

const context = await esbuild.context({
  bundle: true,
  entryPoints: [path.resolve(import.meta.dirname, 'index.js')],
  metafile: true,
  outdir: path.resolve(import.meta.dirname, 'dist'),
  plugins: [cleanPlugin({
      // Plugin options
  })],
});

await context.watch();

Note: The metafile and outdir options must be set for the plugin to have any effect.

Options

  • dry (default false) - Run the plugin in dry mode, not deleting anything. Most useful together with the verbose option to see what would have been deleted.
  • initialCleanPatterns (default ['**/*']) - File patterns to remove on plugin setup, useful to clean the build directory before creating new files. Pass an empty array to disable it.
  • verbose (default false) - Print all files that have been deleted after each run.

Keywords

esbuild

FAQs

Package last updated on 15 Feb 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.