0.4.0 • Published 1 year ago

rollup-plugin-copy2 v0.4.0

Weekly downloads
553
License
MIT
Repository
github
Last release
1 year ago

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

0.4.0

1 year ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

4 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago