Rollup plugin to easily copy files and folders
npm install rollup-plugin-cpy



Rollup plugin to easily copy files and folders.
- yarn
``sh`
yarn add -D rollup-plugin-cpy
- npm
`sh`
npm i -D rollup-plugin-cpy
This plugin uses cpy by @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
`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
`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' },
]),
]
...
``
This project is licensed under the MIT license.