You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, TypeScript-based config files aren’t supported, but adding support would be beneficial for several reasons. First, it would allow users to keep all their config files consistently written in TypeScript. Second, it would enable importing from other TypeScript files — for example, reading entry points from a Rollup config that’s also written in TypeScript.
Currently, the workaround is to use TypeDoc programmatically, which allows me to access anything that’s already in TypeScript. However, it would be much more convenient to just use the CLI and import everything I need directly in the config file.
I'm definitely leaning towards a wontfix for this one.
Rollup is able to do this because its job is literally to transform source code. It bundles your config file and then executes that.
While TypeDoc wraps TypeScript, which can emit transformed JS, doing so in the config file would require that TypeDoc infer some sort of config and use that... and also be responsible for hooking in to Node's APIs to do the transformation. There is a reason that ts-node is no longer maintained - the Node APIs for that are not stable, at least for all current LTS releases. I want to spend what time I have for typedoc working on typedoc, not fighting Node because some API changed.
Furthermore, recent Node versions are adding flags so that they handle type stripping automatically. Anything added in TypeDoc in the meantime is likely wasted work as Node is can already import TS files in a large number of cases. I'm not at a computer right now, but I'm fairly certain that you could point typedoc at a TS config file with Node 23 and see things work.
Search Terms
mts cts config file options
Problem
Currently, TypeScript-based config files aren’t supported, but adding support would be beneficial for several reasons. First, it would allow users to keep all their config files consistently written in TypeScript. Second, it would enable importing from other TypeScript files — for example, reading entry points from a Rollup config that’s also written in TypeScript.
Currently, the workaround is to use TypeDoc programmatically, which allows me to access anything that’s already in TypeScript. However, it would be much more convenient to just use the CLI and import everything I need directly in the config file.
Suggested Solution
Please consider adding support for
typedoc.ts
,typedoc.cts
andtypedoc.mts
config files according to https://www.typescriptlang.org/docs/handbook/modules/reference.html#module-format-detectionThe text was updated successfully, but these errors were encountered: