
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
metalsmith-only-build
Advanced tools
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 falseMETALSMITH_OPEN env var must be set (as a space-separated list of
files to only include)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
}
}
build/%.html: articles/%.html
METALSMITH_ONLY="%<" metalsmith
FAQs
Only build a certain subset of an entire metalsmith site.
We found that metalsmith-only-build demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.