rollup-plugin-copy-assets
Copy additional assets into the output directory of your rollup bundle.
Installation
# add with yarn
yarn add --dev rollup-plugin-copy-assets
# or npm
npm install --save-dev rollup-plugin-copy-assets
Usage
import copy from "rollup-plugin-copy-assets";
export default {
input: "src/index.js",
output: {
file: "dist/bundle.js",
format: "cjs",
},
plugins: [
copy({
assets: [
"src/assets",
"src/external/buffer.bin",
],
}),
],
};
On final bundle generation the provided files will be copied over into the output folder of your rollup bundle, maintaining the original hierarchy and relativity to the input file:
src/
- index.js
- assets/
- some-library-needing-special-treatment.js
- external/
- buffer.bin
dist/
- bundle.js
- assets/
- some-library-needing-special-treatment.js
- external/
- buffer.bin
Options
assets
: (required) An array of paths to copy. Accepts files as well as directories.
License
MIT