Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow configuration to return a promise (async-friendly) #614

@zachleat

Description

@zachleat

More information at #612 by @Munter

I attempted to use an async function in .eleventy.js because I wanted to try something depending on disk access, and usually do those things async. It turned out everything I tried to configure didn't work. The reason for this was that the config resolution doesn't handle async or promises, and just went ahead and merged my returned promise with the default config.

Right now this isn’t possible, this issue suggests that it should be:

module.exports = async function(eleventyConfig) {};

The problem here is that the config is used in constructors all over the code base (which are not async friendly).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfeature: esmRelated to supporting ES Modules (in parallel to CommonJS)feature: 🛠 configurationRelated to Eleventy’s Configuration file

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions