https://github.com/rixo/rollup-plugin-copy-watch
A fork of rollup-plugin-copy that can watch other directories
https://github.com/rixo/rollup-plugin-copy-watch
Last synced: about 1 year ago
JSON representation
A fork of rollup-plugin-copy that can watch other directories
- Host: GitHub
- URL: https://github.com/rixo/rollup-plugin-copy-watch
- Owner: rixo
- Created: 2020-05-16T12:13:46.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T11:23:00.000Z (over 3 years ago)
- Last Synced: 2025-04-21T18:46:13.433Z (about 1 year ago)
- Language: JavaScript
- Size: 399 KB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# rollup-plugin-copy-watch
A fork of [rollup-plugin-copy](https://github.com/vladshcherbin/rollup-plugin-copy) with an additional `watch` to watch other sources than just Rollup's bundle content (e.g. your static assets directory).
[](https://travis-ci.org/vladshcherbin/rollup-plugin-copy)
[](https://codecov.io/gh/vladshcherbin/rollup-plugin-copy)
Copy files and folders, with glob support.
## Installation
```bash
# yarn
yarn add rollup-plugin-copy-watch -D
# npm
npm install rollup-plugin-copy-watch -D
```
## Usage
```js
// rollup.config.js
import copy from 'rollup-plugin-copy-watch'
export default {
input: 'src/index.js',
output: {
file: 'dist/app.js',
format: 'cjs'
},
plugins: [
copy({
// the watch option is passed directly to Chokidar, so it can be a file,
// dir, array or glob(s)
watch: 'static',
targets: [
{ src: 'src/index.html', dest: 'dist/public' },
{ src: ['assets/fonts/arial.woff', 'assets/fonts/arial.woff2'], dest: 'dist/public/fonts' },
{ src: 'assets/images/**/*', dest: 'dist/public/images' }
]
})
]
}
```
### Configuration
The configuration is exactly the same as [rollup-plugin-copy](https://github.com/vladshcherbin/rollup-plugin-copy#configuration), with just one option added. Refer to the original plugin for all other options.
#### watch
Type: `string|string[]` Default: `null`
Paths to files, dirs to be watched recursively, or glob patterns.
This is passed directly to [`chokidar.watch`](https://github.com/paulmillr/chokidar#api).
## Original Author
`rollup-plugin-copy`: [Cédric Meuter](https://github.com/meuter)
## License
MIT