What's Changed
Changed
- Migrated to ES modules (ESM) as primary format
- Script injection moved from
</body>to</head>for better performance - Moved
@11ty/eleventyfrom dependencies to peerDependencies (requires>=2.0.0) - Updated all documentation examples to ESM
Added
- Dual package support (ESM + CJS) via exports field
- CommonJS wrapper (
.eleventy.cjs) for backwards compatibility - Default exclusions for
.zipand.pdffiles linkedomfor reliable HTML parsing
Migration Guide
ESM (Eleventy 3.x):
import eleventyPluginSpeculationRules from 'eleventy-plugin-speculation-rules';
export default function (eleventyConfig) {
eleventyConfig.addPlugin(eleventyPluginSpeculationRules);
};CommonJS (Eleventy 2.x):
const eleventyPluginSpeculationRules = require('eleventy-plugin-speculation-rules');
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(eleventyPluginSpeculationRules);
};