1.1.2 • Published 6 months ago
@pizca/esbuild-reset v1.1.2
@pizca/esbuild-reset
An esbuild plugin that clears the output directory (outdir) before each build.
Installation
npm i -D @pizca/esbuild-resetUsage
Import the plugin and add it to your esbuild build configuration:
import esbuild from 'esbuild';
import resetPlugin from '@pizca/esbuild-reset';
esbuild.build({
    entryPoints: [
        'src/index.ts'
    ],
    bundle: true,
    outdir: 'dist',
    plugins: [
        resetPlugin(),
        // other plugins...
    ],
}).catch(() => process.exit(1));What it does
Before the build starts, this plugin clears the contents of the outdir folder to ensure a clean output directory without leftover files.