Skip to content

Copy additional assets into the output directory of your rollup bundle.

License

Notifications You must be signed in to change notification settings

lmoronil/rollup-plugin-copy-assets

 
 

Repository files navigation

rollup-plugin-copy-assets

build status npm version

Copy additional assets into the output directory of your rollup bundle.

Installation

npm install --save-dev rollup-plugin-copy-assets

Usage

// rollup.config.js
import copy from 'rollup-plugin-copy-assets';

export default {
  entry: 'src/index.js',
  dest: 'dist/bundle.js',
  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.

# Source directory structure
src/
- index.js
- assets/
  - some-library-needing-special-treatment.js
- external/
  - buffer.bin

# Output directory structure
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

About

Copy additional assets into the output directory of your rollup bundle.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%