Giter VIP home page Giter VIP logo

parcel-reporter-static-files-copy's Introduction

parcel-reporter-static-files-copy

ParcelJS v2 plugin to copy static files from some directory to output dir. There is no watcher - files are copied on build finish.

Install

yarn add parcel-reporter-static-files-copy --dev
npm install -D parcel-reporter-static-files-copy

Usage

  1. Create static directory in your project root.
  2. Fill it with your static files
  3. Add plugin to .parcelrc:
{
  "extends": ["@parcel/config-default"],
  "reporters":  ["...", "parcel-reporter-static-files-copy"]
}

PLEASE NOTE: "..." is not a placeholder - it is used to extend default list of plugins (reporters in this case). Please see Parcel's plugins documentation for more information.

  1. Run build - and that's all! Files from static directory will end up in dist!

Customization

Beyond the default settings, you can:

  1. Name of the directory to be copied.
// package.json
  {
	...
  "staticFiles": {
    "staticPath": "customStatic"
  }
  1. Specify directory to copy static files into

If files from staticPath needs to get copied into a subdirectory inside the dist dir - staticOutPath can be used:

// package.json
  {
	...
  "staticFiles": {
    "staticOutPath": "vendor"
  }
  1. Destination of static files

Destination of static files can be set in plugin configuration. It will override --dist-dir parameter.

// package.json
  {
	...
  "staticFiles": {
    "distDir": "customDist"
  }

Additional example

Check examples directory for additional examples.

Flaws and problems

At this moment this plugin copies all static files from some static dir to output (dist) directory. There is no watcher on static files - only trigger is finishing build (no matter if normal build or serving).

Contribute

You're interested in contributing? Awesome! Fork, make change, commit and create pull request. I'll do my best to merge changes!

Thanks and acknowledgement

Special thanks to @gmougeolle.

License

MIT

parcel-reporter-static-files-copy's People

Contributors

elwin013 avatar blakerutledge avatar gauben avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.