Skip to content

Parcel v2 plugin. Copies multiple specified files and folders into specified folders once build finishes successfully.

Notifications You must be signed in to change notification settings

jvidalv/parcel-reporter-multiple-static-file-copier

Repository files navigation

parcel-reporter-multiple-static-file-copier

npm version

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.

About

Parcel v2 plugin. Copies multiple specified files and folders into specified folders once build finishes successfully.

Topics

Resources

Stars

Watchers

Forks