Coder Social home page Coder Social logo

rollup-plugin-cpy's Introduction


rollup-plugin-cpy

JavaScript Style Guide code style: prettier MIT License rollup-plugin-cpy-status 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' },
      ]),
]

...

rollup-plugin-cpy's People

Contributors

paulmelnikow avatar shrynx avatar xboston avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rollup-plugin-cpy's Issues

Update for Rollup v1

I'm seeing this deprecation message in 1.1.0 when upgrading to Rollup 1.0:

(!) rollup-plugin-cpy plugin: The onwrite hook used by plugin rollup-plugin-cpy is deprecated. The generateBundle hook should be used instead.

Add possibility to copy only on start

It would be nice to have an option to copy on start or on write. It's useful in watch mode when you don't want to copy files every time you bundle changes. The option can be named watch or smth.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.