Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mistjs/vite-plugin-copy-files
this is less copy plugin
https://github.com/mistjs/vite-plugin-copy-files
Last synced: 15 days ago
JSON representation
this is less copy plugin
- Host: GitHub
- URL: https://github.com/mistjs/vite-plugin-copy-files
- Owner: mistjs
- License: mit
- Created: 2022-05-04T23:47:23.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-29T07:06:54.000Z (over 1 year ago)
- Last Synced: 2024-10-04T08:36:24.943Z (about 1 month ago)
- Language: TypeScript
- Size: 348 KB
- Stars: 10
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.ts
- License: LICENSE
Awesome Lists containing this project
README
# vite-plugin-copy-files
This package can help you move some files that do not need to be packaged to the corresponding packaging directory.
## Install
```shell
# npm
npm i -D vite-plugin-copy-files
# pnpm
pnpm add -D vite-plugin-copy-files
# yarn
yarn add -D vite-plugin-copy-files```
## Usage
Add the following to your `.vite.config.js` or `.vite.config.ts` file:
```ts
import copyFiles from 'vite-plugin-copy-files'
export default {
plugins: [copyFiles({
include: [/\.(less|css|scss)$/],
exclude: [/node_modules/],
})],
}
```## Options
### include
- `Array`: A list of patterns or string to include.
* default: `[/\.(less|css|scss)$/]`
### exclude
- `Array`: A list of patterns or string to exclude.
* default: `[/node_modules/]`
### root
- `String`: The root directory to copy files from.
* default: with vite config option `root`
### entry
- `String`: The entry directory to copy files from.
* default: `src` if you directory is not named `src` you need to specify the entry directory.
### formatFilePath
- `Function`: A custom file output path Function. `(file:string)=>string`