metalsmith / remove

A Metalsmith plugin to remove files from the build

Home Page:https://github.com/metalsmith/remove#readme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@metalsmith/remove

A Metalsmith plugin to remove files from the build

metalsmith: core plugin npm: version ci: build code coverage license: MIT

Use @metalsmith/remove to discard files from the build output after their metadata and contents have been read and used by plugins. While Metalsmith#ignore ignores the matched files completely, @metalsmith/remove only removes them at the point the plugin is use'd.

Installation

NPM:

npm install @metalsmith/remove

Yarn:

yarn add @metalsmith/remove

Usage

Pass the plugin with options to Metalsmith#use:

import remove from '@metalsmith/remove'

metalsmith.use(remove('drafts/*')) // single pattern
metalsmith.use(remove(['drafts/*', 'unfinished/*'])) // multiple patterns

Debug

To enable debug logs, set the DEBUG environment variable to @metalsmith/remove*:

metalsmith.env('DEBUG', '@metalsmith/remove*')

Alternatively you can set DEBUG to @metalsmith/* to debug all Metalsmith core plugins.

CLI Usage

To use this plugin with the Metalsmith CLI, add @metalsmith/remove to the plugins key in your metalsmith.json file:

{
  "plugins": [{ "@metalsmith/remove": "drafts/*" }]
}

But you can also pass an array of patterns to ignore:

{
  "plugins": [{ "@metalsmith/remove": ["drafts/*", "unfinished/*"] }]
}

License

MIT

About

A Metalsmith plugin to remove files from the build

https://github.com/metalsmith/remove#readme

License:MIT License


Languages

Language:JavaScript 100.0%