Skip to content

Enable plugins to be async #2675

@robole

Description

@robole

Is your feature request related to a problem? Please describe.
There is a 11ty plugin for the syntax highlighting library shiki twoslash. This libary uses WASM under the hood and needs to run asynchronously. In the plugin, they need to fudge synchronous behavior by using the deasync to make it run in 11ty. For this reason, the performance is poor.

For example, at the moment, I am currently migrating a website to 11ty with 100 pages and the build time is 1.5seconds, with incremental builds a file change reloads in milliseconds. If I add the twoslash plugin, it pushes the build time to 8 seconds, and incremental builds take the same time. Having that as a dev mode experience is too painful.

Describe the solution you'd like
Permitting an async function to be used by addPlugin().

Describe alternatives you've considered
Using deasync is the alternative tried.

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

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions