🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

rollup-plugin-copy-watch

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-copy-watch

Copy files and folders using Rollup

0.0.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

rollup-plugin-copy-watch

A fork of rollup-plugin-copy with an additional watch to watch other sources than just Rollup's bundle content (e.g. your static assets directory).

Build Status Codecov

Copy files and folders, with glob support.

Installation

# yarn
yarn add rollup-plugin-copy-watch -D

# npm
npm install rollup-plugin-copy-watch -D

Usage

// 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, 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.

Original Author

rollup-plugin-copy: Cédric Meuter

License

MIT

Keywords

rollup

FAQs

Package last updated on 16 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts