1.0.5 • Published 3 years ago

parcel-reporter-multiple-static-file-copier v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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:

PropertyPath
originExample: node_modules/@package/public
destinationExample: 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.