vite-plugin-clean-build
v1.2.1
Published
A vite plugin for remove/clean files after build.
Downloads
128
Maintainers
Readme
vite-plugin-clean-build
A vite plugin for remove/clean files after build.
Table of Contents
Installation
# npm
npm i vite-plugin-clean-build -D
# yarn
yarn add vite-plugin-clean-build -D
# pnpm
pnpm add vite-plugin-clean-build -D
Usage
Here's an example vite config illustrating how to use this plugin
vite.config.js
import CleanBuild from 'vite-plugin-clean-build';
export default {
plugins: [CleanBuild()],
}
You can pass a hash of configuration options to vite-plugin-clean-build
.
Allowed values are as follows:
|Name|Type|Default|Description|
|:--:|:--:|:-----:|:----------|
|outputDir
|{string}
|'dist'
|Removes files in the directory|
|patterns
|{Array<string>}
|[]
|Removes files after every build that match this pattern|
|verbose
|{boolean}
|false
|Write logs to console|
Here's an example vite config illustrating how to use these options
vite.config.js
import CleanBuild from 'vite-plugin-clean-build';
export default {
plugins: [CleanBuild(
{
outputDir: 'dist',
patterns: [
'images/**',
'!images/logo.png'
],
verbose: true,
}
)],
}
Issues
If you encounter some problems during use, please click here Issue Report
License
Copyright (c) 2023-present cnpath