{"name":"rollup-plugin-copy","description":"Copy files and folders using Rollup","version":"3.0.0","author":{"name":"Vlad Shcherbin","email":"vlad.shcherbin@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/vladshcherbin/rollup-plugin-copy.git"},"main":"dist/index.commonjs.js","module":"dist/index.module.js","types":"index.d.ts","scripts":{"clean":"rimraf coverage dist","build":"rollup -c","lint":"eslint src tests","postpublish":"yarn clean","prepublishOnly":"yarn lint && yarn test && yarn clean && yarn build","test":"jest"},"dependencies":{"@types/fs-extra":"^7.0.0","colorette":"^1.0.8","fs-extra":"^7.0.1","globby":"^9.2.0","is-plain-object":"^3.0.0"},"devDependencies":{"@babel/core":"^7.4.5","@babel/preset-env":"^7.4.5","babel-jest":"^24.8.0","codecov":"^3.5.0","eslint":"^5.16.0","eslint-config-airbnb-base":"^13.1.0","eslint-plugin-import":"^2.17.3","jest":"^24.8.0","replace-in-file":"^4.1.0","rimraf":"^2.6.3","rollup":"^1.14.6","rollup-plugin-auto-external":"^2.0.0","rollup-plugin-babel":"^4.3.2"},"keywords":["rollup","rollup-plugin","copy","cp","asset","assets","file","files","folder","folders","glob"],"engines":{"node":">=8.3"},"license":"MIT","gitHead":"cd7b4c46219e7eb4d483fa8874b586a36a5dbca9","bugs":{"url":"https://github.com/vladshcherbin/rollup-plugin-copy/issues"},"homepage":"https://github.com/vladshcherbin/rollup-plugin-copy#readme","_id":"rollup-plugin-copy@3.0.0","_nodeVersion":"12.1.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-KLXcjur3O5DbCX5NNSFPAGjcncYcEV/sAy4Q6cZvCjW0/hh5TrUeTvrWECVF18EggK64AOAWCeb2kCpwp+1Q+A==","shasum":"ef53214ace42d99b765ca998e285920470b5d1d9","tarball":"http://registry-npm.ywwl.com/rollup-plugin-copy/download/rollup-plugin-copy-3.0.0.tgz","fileCount":5,"unpackedSize":11275,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc/uz0CRA9TVsSAnZWagAAo5AP/i8FcO1Ssrs0lvpiWs4x\no9zIaoXu2EQT6PrNK5ruhEMyq5g67ByCCAmXvm5Tt3fwkTrfhasCZGAdpBOf\n1olOEtR+bwIFe0afhQq4qeGyRacIgClVkprzbGr7uAiLAbwWt69VByZEFTwk\nUtq5h9vcGQmqwWKDGQ4cxxW7gjwHrR25VlxeTb4kKcukKIMQ9EnOCuruFDs/\n9Y7w2uQ5lAjClbfdelp9IgxBbxVrNTjxhYl1KhN0GD/rGF1FeWN+bk6cobIj\ngrvAiB90+aLDWQx4Klu29VaedtAFziBHbMFsG1NjHtaZmLpqNcL+y1KFBD5I\n0XnP+Yo+3xbgY5RulHCX8XZv7LbpDV8LWq8zPwtm9MvTPjcn3hDzCcnaS8oz\nVGMgEVxUnrpwO+CcDjuFb1Phz9617AwzgzJa9ywkPaLHo6hegNFWdN96p6/x\n4r4jY4OMsuKWYGo4/esG7sT47xdSITZeKFu0oR6nqRVHuVunDiC8tIhC371u\nAznLFZoo83cd5Xtz+LQvd7P+uwB9CqwvlAVWMfHn/g+sl0yDyBdMZ5fAbSaO\nyjv5balPOda2bnupVfIyRdge2lolsBnz3t1YmEsQGd4oD6IkBHVjl/lbr/uC\nJR+gqaFjh18WkBW9YagBKmD2EXnRI4c6OS4WxJpLKdwg7eFBLBLaQk3lUG93\n9JyF\r\n=9NMD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG7AmAZpa86QMZ0O7/1vzkza1ltp7/1YUuXEBUoSoMADAiAIsgOMxqJIHvtkE4n1hJG7RYCNB9uvd0+84BZjAcTEeQ=="}],"size":3047,"noattachment":false,"key":"/rollup-plugin-copy/-/rollup-plugin-copy-3.0.0.tgz"},"maintainers":[{"email":"vlad.shcherbin@gmail.com","name":"shcherbin"}],"_npmUser":{"name":"shcherbin","email":"vlad.shcherbin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-copy_3.0.0_1560210675983_0.05577579629209928"},"_hasShrinkwrap":false,"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":1560210676149,"_cnpm_publish_time":1560210676149,"dist-tags":{"latest":"3.5.0"}}