How to use code between node.js server and browser using Typescript

I plan to make a small multi-player javascript game with the node.js server (using socket.io) and would like to share some code (mainly classes) between the web client and the server. So I found this:

How can I share the code between node.js and the browser?

However, I would also like to use Typescript and wondered how to configure it? What tsconfig.json settings are best suited for this? Should I use something like a browser or webpack?

+4
source share
1 answer

Should I use something like a browser or webpack?

Yes. I am using webpack.

tsconfig.json

commonjs .

typescript backend/frontend.... webpack... tsconfig.json: https://github.com/alm-tools/alm

+3

All Articles