Add Full Support For TypeScript
See original GitHub issue🚀 Feature
The ability to run docusaurus in a TypeScript environment
Have you read the Contributing Guidelines on issues?
Yes
Motivation
I would personally like to see this because myself and likely others prefer TypeScript to writing pure Node.js, and I believe it is a relatively small change.
Pitch
There are already 7 upvotes on the TypeScript suggestion by Zihua Wu on the Docusaurus 2 feedback website.
- It would require no new dependencies
- I am willing to work on a PR
- Modify how docusaurus loads files for rendering the website:
require()files without providing a specific extension- Support processing
.tsand.tsxfile extensions
Issue Analytics
- State:
- Created 4 years ago
- Reactions:14
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Add TypeScript support to an existing codebase | by Billel
Add TypeScript support to an existing codebase · Install typescript npm package and node type definitions. Just run npm i --save-dev typescript @types/node ......
Read more >How to set up TypeScript
You can use npm to install TypeScript globally, this means that you can use the tsc command anywhere in your terminal. To do...
Read more >How to Add TypeScript to a JavaScript Project - freeCodeCamp
How to convert a JavaScript application to support TypeScript. · Install typescript · Typescript config file · Create your first .TS file in...
Read more >TypeScript Programming with Visual Studio Code
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It offers classes, modules, and interfaces to help you build robust...
Read more >Typescript - Strapi Developer Docs
Strapi supports TypeScript in new projects on v4.3.0 and above. Existing JavaScript projects can add TypeScript support through a conversion ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@sarunast Your PR looks great, and is a simple change like I imagined.
@SleepWalker
I think you will want to make a separate issue for Flow support, if that’s what you’re looking to do.Apologies, I misunderstood your question. I’m not sure aboutmdxor if Docusaurus already supports it – but I would still recommend separate feature requests for Flow andmdxsupport.I managed to get it work with TSX (docusaurus v2). Here is the config file from my project: https://github.com/sarunast/german-grammar/blob/master/webpackConfigPlugin/index.js
After that, you load it as a plugin in config. I guess it would be best if someone could create an actual plugin package.