@metalsmith/remove
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

@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

Package Sidebar

Install

npm i @metalsmith/remove

Weekly Downloads

136

Version

1.4.0

License

MIT

Unpacked Size

16.2 kB

Total Files

8

Last publish

Collaborators

  • webketje
  • woodyrew
  • wernerglinka