vite-plugin-clean-pattern
v1.0.4
Published
A vite plugin to remove/clean your build folder(s) using regex patterns to match specific files.
Downloads
60
Maintainers
Readme
vite-plugin-clean-pattern
A vite plugin to remove/clean your build folder(s) using regex patterns to match specific files.
Credit
Credit to flyfox (https://github.com/flyfox11) for their work on vite-plugin-cleaner (https://github.com/z-ti/vite-plugin-clean/tree/main) which this plugin is based on.
Table of Contents
Installation
bun i --dev vite-plugin-clean-pattern
npm i --save-dev vite-plugin-clean-pattern
yarn add --dev vite-plugin-clean-pattern
Usage
Here's an example vite config illustrating how to use this plugin
vite.config.js
import cleanPlugin from 'vite-plugin-clean-pattern';
export default {
plugins: [cleanPlugin()],
}
You can pass a hash of configuration options to vite-plugin-clean-pattern
.
Allowed values are as follows:
|Name|Type|Default|Description|
|:--:|:--:|:-----:|:----------|
|targetFiles
|{Array.<string>}
|['dist']
|List of directories removed before packing the file|
Here's an example vite config illustrating how to use these options
vite.config.js
import cleanPlugin from 'vite-plugin-clean-pattern';
export default {
plugins: [cleanPlugin(
{
targetFiles: [{ dirPath: 'dist', fileMatchPattern: '^vite_.*_[0-9a-zA-Z-_]{8}' }, ...]
}
)],
}
Issues
If you encounter some problems during use, please click here Issue Report
License
Copyright (c) 2023-present Jason Hassold