eleventy-load Lightning

Save assets with hashed filenames

You can use eleventy-load-file to save assets to the output directory, including text-based files like SVGs and binary files like JPEGs. In your HTML, reference your assets like normal, for example, an img element.

<img src="cat.jpeg" alt="Fat cat staring out of a window" />
module.exports = function (eleventyConfig) {
  eleventyConfig.addPlugin(require("eleventy-load"), {
    rules: [
      {
        test: /\.(md|html)$/,
        loaders: [
          {
            loader: require("eleventy-load-html"),
          },
        ],
      },
      {
        test: /\.(avif|gif|png|jpe?g|webp)$/,
        loaders: [
          {
            loader: require("eleventy-load-file"),
          },
        ],
      },
    ],
  });
};