Skip to content

v2.0.0

Latest

Choose a tag to compare

@reatlat reatlat released this 24 Dec 16:38

What's Changed

Changed

  • Migrated to ES modules (ESM) as primary format
  • Script injection moved from </body> to </head> for better performance
  • Moved @11ty/eleventy from 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 .zip and .pdf files
  • linkedom for 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);
};