In the documentation (https://www.11ty.dev/docs/data-global-custom/) for Eleventy it states that you can use the following as one option for adding custom global data:
// .eleventy.js
module.exports = function(eleventyConfig) {
eleventyConfig.addGlobalData("myFunctionPromise", () => {
return new Promise((resolve) => {
setTimeout(resolve, 100, "foo");
})
});
};
When attempting to use this within the .eleventy.js
project configuration file it fails with:
> eleventyConfig.addGlobalData is not a function
However, custom collections can be defined on eleventyConfig
using eleventyConfig.addCollection
without any issues.
What is the issue here?