parcel-reporter-multiple-static-file-copier

1.0.5 • Public • Published

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 ⚠️ must extend Parcel configuration with the plugin name in .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.

Package Sidebar

Install

npm i parcel-reporter-multiple-static-file-copier

Weekly Downloads

21

Version

1.0.5

License

MIT

Unpacked Size

3.92 kB

Total Files

8

Last publish

Collaborators

  • jvidalv