Socket
Socket
Sign inDemoInstall

rollup-plugin-copy-assets

Package Overview
Dependencies
23
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rollup-plugin-copy-assets

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


Version published
Weekly downloads
16K
increased by10.32%
Maintainers
1
Install size
329 kB
Created
Weekly downloads
 

Changelog

Source

2.0.3

  • Fix asset paths that are deeper than 1 level (#18, thanks @sxxov)
  • Allow rollup-input to be an object (#12, thanks @EtienneBruines)

Readme

Source

rollup-plugin-copy-assets

build status coverage npm version

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

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

export default {
  input: "src/index.js",
  output: {
    file: "dist/bundle.js",
    format: "cjs",
  },
  plugins: [
    copy({
      assets: [
        // You can include directories
        "src/assets",
        // You can also include files
        "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:

# 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

Keywords

FAQs

Last updated on 18 Nov 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc