I am working on a web application using TypeScript. For some parts of the application, I would like to define a simple configuration file that specifies certain aspects (for example the color palette).
How would I create such a configuration file? In JavaScript, creating config.js
and referencing it in the HTML code is a very simple solution. What would be the best solution for TypeScript? Maybe a separate Config.ts
file?
As Typescript is transpiled into JavaScript there is no difference in your usecase. The browser does not get the TS code but the JS.