Skip to content

RobLoach/metalsmith-concat-convention

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is up to date with kalamuna/metalsmith-concat-convention:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Metalsmith Concat Convention Plugin NPM version

Build Status Dependency Status Greenkeeper badge

Metalsmith plugin to concatenate files through file conventions.

Installation

npm install --save metalsmith-concat-convention

CLI

If you are using the command-line version of Metalsmith, you can install via npm, and then add the metalsmith-concat-convention key to your metalsmith.json file:

{
  "plugins": {
    "metalsmith-concat-convention": {
      "extname": ".concat"
    }
  }
}

JavaScript

If you are using the JS Api for Metalsmith, then you can require the module and add it to your .use() directives:

var concat = require('metalsmith-concat-convention');

metalsmith.use(concat({
  extname: '.concat'
}));

Usage

Each concatenation is handled through naming the destination file <name>.concat. The file's metadata options are passed off to metalsmith-concat to output the concatenated files. All metalsmith-concat options apply, aside from output, which is provided by the filename itself.

Example

src/scripts.js.concat

---
files:
- script1.js
- script2.js
insertNewLine: false
---
// This is the collection of all scripts.

The above will result in scripts.js being script1.js, script2.js, along with the ending content comment.

License

MIT

About

Metalsmith plugin to concatenate files through file conventions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%