New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rollup-plugin-copy2

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-copy2

Rollup plugin to copy additional assets to the build directory.

0.4.0
latest
Source
npm
Version published
Weekly downloads
117
-11.36%
Maintainers
1
Weekly downloads
 
Created
Source

rollup-plugin-copy2

Rollup plugin to copy additional assets to the build directory.

This plugin actually does not copy assets by default but adds them to the resulting bundle so they could be accessed by other plugins (for example by the rollup-plugin-zip).

The actual copying is made by the Rollup itself.

Install

npm i -D rollup-plugin-copy2

Usage

// rollup.config.js

import {copy} from 'rollup-plugin-copy2'

export default {
  input: 'index.js',
  output: {
    dir: 'dist',
    format: 'es',
  },
  plugins: [
    copy({
      assets: [
        'README.md',
        ['data.txt', 'assets/data.txt'],
      ]
    }),
  ],
}

Options

assets

Type
(string | [string, string])[]

An array of assets to copy. Each entry can be

  • a string that contains a relative path to the source file
  • a glob compatible path resulting to one or some files like node_modules/static-deps/**/*.css
  • a pair of strings [string, string] that contains relative paths to the source (not glob ones) and destination files.

If an entry is a single string then the destination file path will be equal to it (relative to the output directory).

notEmitFiles

Type
boolean?

Do not emit files with Rollup. Use this option with outputDirectory if you only want to copy files to a specific directory.

outputDirectory

Type
string?

A path to the additional output directory in case you want to write copied files on disk.

If not set, the files are only emitted to the others plugins.

License

MIT © Petr Tsymbarovich

Keywords

rollup

FAQs

Package last updated on 23 Apr 2023

Did you know?

Socket

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