parcel-reporter-multiple-static-file-copier
This is a plugin for Parcel v2 that copies multiple specified files and folders into specified folders once build finishes successfully (Event: buildSuccess).
Inspired by this plugin.
Install
Yarn
$ yarn add -D parcel-reporter-multiple-static-file-copier
NPM
$ 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 .parcelrc
:
{
"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
{
"multipleStaticFileCopier": [
{
"origin": "public",
"destination": "dist/public/"
}
]
}
Todo
- [ ] Add event type prop in configuration.