Photo by Markus Winkler on Unsplash

This is a solution applicable in the context of using TypeScript in a project that runs in Node.js as apposed to in the browser. Additionally, it also covers exporting your code as a library to be imported by an external tool.

Say having your code spread across multiple files and directories is not an option. The code needs to all be in one single file.

For example, one of the following might apply:

  • You can’t export to AMD or System.js module systems to run your bundled code.
  • The production environment flattens the directory structure of your code before execution.
  • You…

Jack Hollis-London

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store