Skip to content

Rollup plugin to easily copy files and folders

License

Notifications You must be signed in to change notification settings

paulmelnikow/rollup-plugin-cpy

Folders and files

NameName
Last commit message
Last commit date
Jul 2, 2019
Jul 2, 2019
Mar 25, 2018
Mar 25, 2018
Jul 2, 2019
Mar 25, 2018
Mar 25, 2018
Jul 14, 2019
Mar 25, 2018
Jul 2, 2019
Jul 2, 2019
Dec 10, 2020
Dec 28, 2019
Jul 2, 2019

Repository files navigation

rollup-plugin-cpy

JavaScript Style Guide code style: prettier MIT License npm version

Rollup plugin to easily copy files and folders.

Installation

  • yarn
yarn add -D rollup-plugin-cpy
  • npm
npm i -D rollup-plugin-cpy

Usage

This plugin uses cpy by @sindresorhus.

All the options map to the cpy package apart from verbose.

It takes a config object

{
  files: string | glob | Array<string & glob>
  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

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

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.