Giter VIP home page Giter VIP logo

metalsmith-only-build's Introduction

metalsmith-only-build

Build only a specific set of files from metalsmith.

The default behavior of metalsmith is to always rebuild everything. The main purpose of this plugin is to try and streamline builds as much as possible during development. (particularly for make users)

Before metalsmith starts writing files, this plugin will delete every reference from the files hash that is not specified to be built. This causes Metalsmith to skip these files during the last phase of the build. (this plugin should be last in order to prevent unwanted side-effects)

Most plugins assume that all files in the build will be available in memory, so we cannot safely reject files from the build at the outset. However, by skipping the I/O required to write those files at the end, we can save some build time, while also allowing make to be used properly.

This plugin goes to great lengths to not change the default behavior of Metalsmith unless it is very clear that is the intent of the dev.

  • Metalsmith.clean must be set to false
  • a METALSMITH_ONLY env var must be set (as a space-separated list of files to only include)

Configuration

var only = require('metalsmith-only-build');

// make sure this plugin is **last**
metalsmith.use(only())
{
  "plugins": {
    // make sure this plugin is **last**
    "metalsmith-only-build": true
  }
}

Usage

build/%.html: articles/%.html
  METALSMITH_ONLY="%<" metalsmith

metalsmith-only-build's People

Contributors

dominicbarnes avatar ianstormtaylor avatar

Stargazers

Pavel Sevcik avatar 曹文忠 avatar Anthony Fiorani avatar Connor Walsh avatar

Watchers

Travis Jeffery avatar Garrett Johnson avatar  avatar Prakash Durgani avatar david birdsong avatar James Cloos avatar Achille avatar Andrius Vaskys avatar Julien Fabre avatar Andy Jiang avatar George Wolf avatar Rakesh Nair avatar  avatar Gurdas Nijor avatar  avatar Karthick Sriraman avatar Andrew Meyer avatar Andrew Goodricke avatar  avatar Niels avatar  avatar Sam Johnson avatar Chris Smith avatar  avatar  avatar  avatar Sherry Chao avatar Jenn Boyce avatar Michael Phillips avatar Christopher Albanese avatar Brent Summers avatar  avatar  avatar Laylee Asgari avatar  avatar  avatar  avatar Alex Noonan avatar Teresa Nesteby avatar Chris Nixon avatar  avatar  avatar Zeb avatar Liz Hartmann avatar Arlen McCluskey avatar  avatar Ian Muceus avatar  avatar Emilio Gomez Lavin avatar  avatar Kate Flaming avatar  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.