# webpack-blocks-copy

> A webpack-block for copy-webpack-plugin

Latest version **1.0.2** (published 2017-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install webpack-blocks-copy
pnpm add webpack-blocks-copy
yarn add webpack-blocks-copy
bun add webpack-blocks-copy
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-04-15 |
| First published | 2017-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Brandon Konkle |
| Maintainers | bkonkle |
| Keywords | webpack, webpack-blocks, copy-webpack-plugin |

## Links

- npm: https://www.npmjs.com/package/webpack-blocks-copy
- Repository: https://github.com/ecliptic/webpack-blocks-copy
- Homepage: https://github.com/ecliptic/webpack-blocks-copy#readme
- Issues: https://github.com/ecliptic/webpack-blocks-copy/issues
- npm.io page: https://npm.io/package/webpack-blocks-copy

## Dependencies (2)

- [deepmerge](https://npm.io/package/deepmerge.md) ^1.3.2
- [copy-webpack-plugin](https://npm.io/package/copy-webpack-plugin.md) ^4.0.1

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-04-15
- 2.0.0-beta.0 (next) — 2017-05-30
- 1.0.1 — 2017-04-15
- 1.0.0 — 2017-04-15

## README

# webpack-blocks-copy

A [webpack-block](https://github.com/andywer/webpack-blocks) for [copy-webpack-plugin](https://github.com/kevlened/copy-webpack-plugin).

[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
[![NPM Version](https://img.shields.io/npm/v/webpack-blocks-copy.svg)](https://www.npmjs.com/package/webpack-blocks-copy)

## Installation

```sh
yarn add --dev webpack-blocks-copy
```

or

```sh
npm install --save-dev webpack-blocks-copy
```

## Usage

The most basic way to use the plugin is to import `copy` and use it to define simple *from*, *to* pairs that are added to the list of patterns used when the plugin is instantiated.

```js
import {createConfig, entryPoint, setOutput} from '@webpack-blocks/webpack2'
import babel from '@webpack-blocks/babel6'
import {copy} from './src/webpack-block-copy'

export default createConfig([
  entryPoint(['babel-polyfill', './src/Main.js']),
  setOutput('./build/bundle.js'),
  babel(),
  copy('assets/robots.txt', 'robots.txt'),
  copy('assets/favicon.ico', 'favicon.ico'),
])
```

This would result in the following CopyPlugin config:

```js
new CopyWebpackPlugin([
  {from: 'assets/robots.txt', to: 'robots.txt'},
  {from: 'assets/favicon.ico', to: 'favicon.ico'},
])
```

### Advanced patterns

If you need to use more advanced patterns, described [here](https://github.com/kevlened/copy-webpack-plugin#pattern-properties), use the `copyPattern` function:

```js
import {createConfig} from '@webpack-blocks/webpack2'
import {copyPattern} from './src/webpack-block-copy'

export default createConfig([
  copyPattern({
    context: 'from/directory',
    from: '**/*',
    to: '/absolute/path',
  }),
])
```

### Options

If you need to set options, use the `copyOptions` function:

```js
import {createConfig} from '@webpack-blocks/webpack2'
import {copyOptions} from './src/webpack-block-copy'

export default createConfig([
  copyOptions({copyUnmodified: true}),
])
```

See the options list [here](https://github.com/kevlened/copy-webpack-plugin#available-options).

## License

This project is licensed under [MIT](https://github.com/ecliptic/webpack-blocks-html/blob/master/LICENSE).

---
_Source: https://npm.io/package/webpack-blocks-copy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
