A Metalsmith plugin that bundles JavaScript files using Rollup. Version 2.0.0 is current; it supports source maps and can ignore processed source files. This plugin is designed for Metalsmith build pipelines where you need to bundle ES modules with Rollup. It only supports the JavaScript API; CLI usage with metalsmith.json is not yet available. The main differentiator is its tight integration with Metalsmith's build process, allowing seamless inclusion of bundled output inside the build directory.
npm install metalsmith-rollupVerified import paths — ran on the pinned version, not inferred.
Shows how to use the plugin with Metalsmith to bundle a JavaScript entry point into a single output file.
Ensure input file exists inside your Metalsmith source folder, and output.dest will be placed in the build folder.
Use JavaScript build file with require('metalsmith-rollup') instead of relying on metalsmith.json plugins configuration.Refer to documentation for current options; avoid relying on undocumented properties.
Use `const rollup = require('metalsmith-rollup');` not `const { rollup } = require('metalsmith-rollup');`Make sure the input path starts from your Metalsmith source directory (e.g., 'src/js/main.js' if your Metalsmith source is 'src').