A Metalsmith plugin (v0.9.1, active development) that automatically discovers, orders, and bundles CSS/JS files from component-based architectures using esbuild. It scans directories for components, validates requirements, resolves CSS @imports, and produces minified bundles with tree shaking. Key differentiators: convention-over-configuration with sensible defaults, support for both ESM and CommonJS, PostCSS integration via esbuild plugins, and a validation system for component properties to catch configuration errors early. Requires Node >=18.0.0 and metalsmith ^2.5.0 as a peer dependency. Release cadence is irregular with several major feature updates in 2024.
npm install metalsmith-bundled-componentsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage with custom component paths and bundled output destinations.
Pin to a specific version (e.g., 0.9.1) and review changelog before upgrading.
Use ESM import syntax for better compatibility with esbuild and future Node releases.
Upgrade Node.js to 18+ or use an older version of the plugin (not recommended).
Update metalsmith to ^2.5.0.
Run `npm install metalsmith-bundled-components` in your project directory.
Use default import: `import bundledComponents from 'metalsmith-bundled-components'`
Ensure you call bundledComponents() with parentheses: `.use(bundledComponents())`