https://github.com/jvidalv/parcel-reporter-multiple-static-file-copier
Parcel v2 plugin. Copies multiple specified files and folders into specified folders once build finishes successfully.
https://github.com/jvidalv/parcel-reporter-multiple-static-file-copier
copier files node parcel plugin reporter static
Last synced: 5 months ago
JSON representation
Parcel v2 plugin. Copies multiple specified files and folders into specified folders once build finishes successfully.
- Host: GitHub
- URL: https://github.com/jvidalv/parcel-reporter-multiple-static-file-copier
- Owner: jvidalv
- Created: 2021-04-11T17:05:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-13T19:34:47.000Z (over 4 years ago)
- Last Synced: 2025-04-21T10:54:18.955Z (6 months ago)
- Topics: copier, files, node, parcel, plugin, reporter, static
- Language: JavaScript
- Homepage:
- Size: 41 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# parcel-reporter-multiple-static-file-copier
[](https://www.npmjs.com/package/parcel-reporter-multiple-static-file-copier)This is a plugin for [Parcel v2](https://v2.parceljs.org) that **copies multiple specified files and folders into specified folders** once build finishes **successfully** (Event: buildSuccess).
Inspired by [this plugin](https://github.com/elwin013/parcel-plugin-static-files-copy).
## Install
Yarn
```bash
$ yarn add -D parcel-reporter-multiple-static-file-copier
```NPM
```bash
$ npm install parcel-reporter-multiple-static-file-copier --save-dev
```## Usage
Configuration is set under `multipleStaticFileCopier` in `package.json`. It must be an array of objects containing `origin` and `destination` props:
| Property | Path |
| ------------- | ------------- |
| origin | Example: _node_modules/@package/public_ |
| destination | Example: _dist/public_ |You **⚠️ must extend** Parcel configuration with the plugin name in `.parcelrc`:
```json
{
"reporters": [
"...",
"parcel-reporter-multiple-static-file-copier"
]
}
```
_*Note that the "..." notation is used to keep the default report plugins loaded by Parcel._## Example
This example will copy the contents of the folder _public_ into the folder _dist/public_.
_(Note that both are in the project root)_`package.json`
```json
{
"multipleStaticFileCopier": [
{
"origin": "public",
"destination": "dist/public/"
}
]
}
```## Todo
- [ ] Add event type prop in configuration.