0.0.3 • Published 6 years ago

rollup-plugin-copied v0.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

rollup-plugin-copied

Copy files && directories with rollup

Build Status Npm package

Install

npm i -D rollup-plugin-copied

Usage

rollup.config.js

const copy = require('rollup-plugin-copied');

const plugin = copy({
  from: './fixtures/',
  to: './dist/images',
  emitFiles: true // defaults to true
}, {
  watch: true
});

// or

const _plugin = copy([
  {
    from: './fixtures/',
    to: './dist/images',
    emitFiles: true // defaults to true
  }
], {
  watch: true
});

const config = {
  plugins: [
    plugin
  ]
}

patterns {Array|Object}

if use Object

NameTypeDefaultDescription
'from'{String}undefinedIf from is directory, to has no extension or ends in '/'
'to'{String}undefinedIf to has extension or from is file
'emitFiles'{String}undefinedenable plugin

if use Array

Array item just like use Object

NameTypeDefaultDescription
'from'{String}undefinedIf from is directory, to has no extension or ends in '/'
'to'{String}undefinedIf to has extension or from is file
'emitFiles'{String}undefinedenable plugin

options

NameTypeDefaultDescription
'exclude'{Array}[]Array of globs to ignore (applied to from)
'include'{Array}[]Array of globs to include (applied to from)
'watch'{Boolean}trueWhen set to false, only the changes of the first resource are monitored, and the monitoring is not repeated.