From 3d8d7b827170b71f74f06cead37abdb3ac1f2102 Mon Sep 17 00:00:00 2001 From: Oscar Date: Thu, 22 Sep 2022 18:46:49 +0200 Subject: [PATCH] feat(11ty): check compat when initialising --- .eleventy.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.eleventy.js b/.eleventy.js index 51200e7..9bf2fb4 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -4,6 +4,7 @@ // eslint-disable-next-line import/no-unassigned-import require("array-flat-polyfill"); +const pkg = require("./package.json"); const sitemap = require("./src/sitemap"); /** @@ -13,6 +14,14 @@ const sitemap = require("./src/sitemap"); * @param {object} options Plugin user options. */ module.exports = function eleventyPluginSitemap(eleventyConfig, options) { + try { + eleventyConfig.versionCheck(pkg["11ty"].compatibility); + } catch (e) { + console.log( + `WARN: Eleventy Plugin (${pkg.name}) Compatibility: ${e.message}` + ); + } + const finalOptions = options || {}; function getSitemap(items) {