A vite plugin for remove/clean files after build.
# npm
npm i vite-plugin-clean-build -D
# yarn
yarn add vite-plugin-clean-build -D
# pnpm
pnpm add vite-plugin-clean-build -D
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,
}
)],
}
If you encounter some problems during use, please click here Issue Report
Copyright (c) 2023-present cnpath