{"name":"rollup-plugin-copy","version":"0.2.3","description":"Simple rollup plugin to copy static assets over to you public directory","main":"index.js","repository":{"type":"git","url":"git+https://github.com/meuter/rollup-plugin-copy.git"},"scripts":{},"keywords":["rollup","copy","plugin","rollup-plugin"],"author":{"name":"Cédric Meuter","email":"cedric.meuter@gmail.com"},"license":"MIT","dependencies":{"colors":"^1.1.2","fs-extra":"^3.0.0"},"gitHead":"7eb8ff59fe3ad50472361c79fd04b0b98455e5e5","bugs":{"url":"https://github.com/meuter/rollup-plugin-copy/issues"},"homepage":"https://github.com/meuter/rollup-plugin-copy#readme","_id":"rollup-plugin-copy@0.2.3","_shasum":"dac1ab81d1f220baeb98e5c4c0108252e1edbb98","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"meuter","email":"cedric.meuter@gmail.com"},"dist":{"shasum":"dac1ab81d1f220baeb98e5c4c0108252e1edbb98","tarball":"http://registry-npm.ywwl.com/rollup-plugin-copy/download/rollup-plugin-copy-0.2.3.tgz","integrity":"sha512-tyRDXWPYttpReRdBDx79etry1unIUrO2PqolmO3p2B+IR87cAeX8OMGdoxzXFlry6wW3zroEg9V/iAAGk23sXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7kI6Vyvz9dVgHJw2hb0ZinCute38uHfxYwqdACYuxPQIhAIQzOqff60XU6wKV7f8pFLF4nZac3+5Tr6BVBPRpoXs6"}],"size":1913,"noattachment":false,"key":"/rollup-plugin-copy/-/rollup-plugin-copy-0.2.3.tgz"},"maintainers":[{"name":"meuter","email":"cedric.meuter@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/rollup-plugin-copy-0.2.3.tgz_1493468893685_0.2734428879339248"},"directories":{},"readme":"# rollup-plugin-copy\n\n[![Build Status](https://travis-ci.com/vladshcherbin/rollup-plugin-copy.svg?branch=master)](https://travis-ci.com/vladshcherbin/rollup-plugin-copy)\n[![Codecov](https://codecov.io/gh/vladshcherbin/rollup-plugin-copy/branch/master/graph/badge.svg)](https://codecov.io/gh/vladshcherbin/rollup-plugin-copy)\n\nCopy files and folders, with glob support.\n\n## Installation\n\n```bash\n# yarn\nyarn add rollup-plugin-copy -D\n\n# npm\nnpm install rollup-plugin-copy -D\n```\n\n## Usage\n\n```js\n// rollup.config.js\nimport copy from 'rollup-plugin-copy'\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/app.js',\n    format: 'cjs'\n  },\n  plugins: [\n    copy({\n      targets: [\n        { src: 'src/index.html', dest: 'dist/public' },\n        { src: ['assets/fonts/arial.woff', 'assets/fonts/arial.woff2'], dest: 'dist/public/fonts' },\n        { src: 'assets/images/**/*', dest: 'dist/public/images' }\n      ]\n    })\n  ]\n}\n```\n\n### Configuration\n\nThere are some useful options:\n\n#### targets\n\nType: `Array` | Default: `[]`\n\nArray of targets to copy. A target is an object with properties:\n\n- **src** (`string` `Array`): Path or glob of what to copy\n- **dest** (`string` `Array`): One or more destinations where to copy\n- **rename** (`string` `Function`): Change destination file or folder name\n- **transform** (`Function`): Modify file contents\n\nEach object should have **src** and **dest** properties, **rename** and **transform** are optional. [globby](https://github.com/sindresorhus/globby) is used inside, check it for [glob pattern](https://github.com/sindresorhus/globby#globbing-patterns) examples.\n\n##### File\n\n```js\ncopy({\n  targets: [{ src: 'src/index.html', dest: 'dist/public' }]\n})\n```\n\n##### Folder\n\n```js\ncopy({\n  targets: [{ src: 'assets/images', dest: 'dist/public' }]\n})\n```\n\n##### Glob\n\n```js\ncopy({\n  targets: [{ src: 'assets/*', dest: 'dist/public' }]\n})\n```\n\n##### Glob: multiple items\n\n```js\ncopy({\n  targets: [{ src: ['src/index.html', 'src/styles.css', 'assets/images'], dest: 'dist/public' }]\n})\n```\n\n##### Glob: negated patterns\n\n```js\ncopy({\n  targets: [{ src: ['assets/images/**/*', '!**/*.gif'], dest: 'dist/public/images' }]\n})\n```\n\n##### Multiple targets\n\n```js\ncopy({\n  targets: [\n    { src: 'src/index.html', dest: 'dist/public' },\n    { src: 'assets/images/**/*', dest: 'dist/public/images' }\n  ]\n})\n```\n\n##### Multiple destinations\n\n```js\ncopy({\n  targets: [{ src: 'src/index.html', dest: ['dist/public', 'build/public'] }]\n})\n```\n\n##### Rename with a string\n\n```js\ncopy({\n  targets: [{ src: 'src/app.html', dest: 'dist/public', rename: 'index.html' }]\n})\n```\n\n##### Rename with a function\n\n```js\ncopy({\n  targets: [{\n    src: 'assets/docs/*',\n    dest: 'dist/public/docs',\n    rename: (name, extension, fullPath) => `${name}-v1.${extension}`\n  }]\n})\n```\n\n##### Transform file contents\n\n```js\ncopy({\n  targets: [{\n    src: 'src/index.html',\n    dest: 'dist/public',\n    transform: (contents, filename) => contents.toString().replace('__SCRIPT__', 'app.js')\n  }]\n})\n```\n\n#### verbose\n\nType: `boolean` | Default: `false`\n\nOutput copied items to console.\n\n```js\ncopy({\n  targets: [{ src: 'assets/*', dest: 'dist/public' }],\n  verbose: true\n})\n```\n\n#### hook\n\nType: `string` | Default: `buildEnd`\n\n[Rollup hook](https://rollupjs.org/guide/en/#hooks) the plugin should use. By default, plugin runs when rollup has finished bundling, before bundle is written to disk.\n\n```js\ncopy({\n  targets: [{ src: 'assets/*', dest: 'dist/public' }],\n  hook: 'writeBundle'\n})\n```\n\n#### copyOnce\n\nType: `boolean` | Default: `false`\n\nCopy items once. Useful in watch mode.\n\n```js\ncopy({\n  targets: [{ src: 'assets/*', dest: 'dist/public' }],\n  copyOnce: true\n})\n\n```\n#### copySync\n\nType: `boolean` | Default: `false`\n\nCopy items synchronous.\n\n```js\ncopy({\n  targets: [{ src: 'assets/*', dest: 'dist/public' }],\n  copySync: true\n})\n```\n\n#### flatten\n\nType: `boolean` | Default: `true`\n\nRemove the directory structure of copied files.\n\n```js\ncopy({\n  targets: [{ src: 'assets/**/*', dest: 'dist/public' }],\n  flatten: false\n})\n```\n\nAll other options are passed to packages, used inside:\n  - [globby](https://github.com/sindresorhus/globby)\n  - [fs-extra copy function](https://github.com/jprichardson/node-fs-extra/blob/7.0.0/docs/copy.md)\n\n## Original Author\n\n[Cédric Meuter](https://github.com/meuter)\n\n## License\n\nMIT\n","publish_time":1493468895649,"_cnpm_publish_time":1493468895649,"dist-tags":{"latest":"3.5.0"}}