-
-
Notifications
You must be signed in to change notification settings - Fork 740
Closed
Milestone
Description
Search Terms
native ecmascript, esm, plugin
Problem
It would be nice to write TypeDoc plugins as ESM modules, using node's new native ESM support
Suggested Solution
typedoc can first try to require()
the plugin, then if it gets an ERR_REQUIRE_ESM
error, it can import()
it instead. This will support both CJS and ESM and will also support CJS transpilers like ts-node. I'm not sure if the ts-node use-case is meant to be supported or not. If not, typedoc can merely import()
the plugins.
import()
is async; I don't know if typedoc's plugin loading can be async.
balazsorban44