1.0.0 • Published 12 months ago
metalsmith-static-files v1.0.0
metalsmith-static-files
A Metalsmith plugin to copy a directory to the build directory
Installation
NPM:
npm install metalsmith-static-filesYarn:
yarn add metalsmith-static-filesUsage
Pass metalsmith-static-files to metalsmith.use. The source directory path is resolved to metalsmith.directory(). The destination path is resolved to metalsmith.destination().
const add = require('metalsmith-static-files')
metalsmith.use(add({
source: 'src/assets/',
destination: 'assets/',
}))Plugin order
Typically, you want to use this plugin somewhere at the start of the chain, before any asset plugins are run, like @metalsmith/sass.
Debug
To enable debug logs, set the DEBUG environment variable to metalsmith-static-files:
Linux/Mac:
DEBUG=metalsmith-static-filesWindows:
set "DEBUG=metalsmith-static-files"CLI usage
To use this plugin with the Metalsmith CLI, add metalsmith-static-files to the plugins key in your metalsmith.json file:
{
"plugins": [
{
"metalsmith-static-files": {}
}
]
}