Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paulmelnikow/rollup-plugin-cpy
Rollup plugin to easily copy files and folders
https://github.com/paulmelnikow/rollup-plugin-cpy
copy-file copy-files rollup rollup-plugin
Last synced: about 2 months ago
JSON representation
Rollup plugin to easily copy files and folders
- Host: GitHub
- URL: https://github.com/paulmelnikow/rollup-plugin-cpy
- Owner: paulmelnikow
- License: mit
- Created: 2019-07-02T15:07:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-04T01:38:25.000Z (about 2 years ago)
- Last Synced: 2024-05-14T15:44:38.574Z (7 months ago)
- Topics: copy-file, copy-files, rollup, rollup-plugin
- Language: JavaScript
- Size: 375 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome - cpy - Easily copy files and folders during a build. (Plugins / Output)
README
# rollup-plugin-cpy
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](https://standardjs.com)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![MIT License](https://img.shields.io/npm/l/rollup-plugin-cpy.svg?style=flat-square)](https://github.com/paulmelnikow/rollup-plugin-cpy/blob/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/rollup-plugin-cpy.svg?style=flat-square)](https://npmjs.com/package/rollup-plugin-cpy)Rollup plugin to easily copy files and folders.
## Installation
- yarn
```sh
yarn add -D rollup-plugin-cpy
```- npm
```sh
npm i -D rollup-plugin-cpy
```## Usage
This plugin uses [cpy](https://github.com/sindresorhus/cpy) by [@sindresorhus](https://github.com/sindresorhus).
All the options map to the `cpy` package apart from `verbose`.
It takes a config object
```js
{
files: string | glob | Array
dest: string,
options: {
verbose: boolean,
...restOptions
}
}
```The verbose option if set to true print out each file copying log on console.
`restOptions` are same as [options passed to cpy](https://github.com/sindresorhus/cpy#options)
```js
import copy from 'rollup-plugin-cpy'...
plugins: [
...
copy({
files: ['src/*.png', '!src/goat.png'],
dest: 'dist',
options: {
verbose: true,
...
}
})
]...
```It can also take an array of [above mentioned config object](#usage)
```js
import copy from 'rollup-plugin-cpy'...
plugins: [
...
copy([
{ files: 'src/**/*.png', dest: './dist/images' },
{ files: 'src/**/*.mp3', dest: './dist/audio' },
{ files: 'src/**/*.webm', dest: './dist/video' },
]),
]...
```## License
This project is licensed under the MIT license.