Currently, I am in the process of developing an Electron application and I have decided to implement TypeScript for this project. While TypeScript essentially boils down to JavaScript in the end, my familiarity with it makes the transition seamless.
As of now, my goal is to merge all my TypeScript files into a single, monolithic .js file using the outFile setting, while also organizing my code by class in separate files (properly namespaced when necessary).
I have been utilizing references in TypeScript and employing the namespace keyword to divide my code into logical sections. Additionally, I have been using "export class" to facilitate access to required components. However, I encounter challenges when attempting to import modules like fs or lodash, resulting in errors related to "define is not defined". Although I experimented with importing AMD loader or RequireJS, these solutions proved ineffective.
Upon further research, I learned that combining Internal and External modules in TypeScript 1.8 is discouraged.
Hence, my main query revolves around structuring my TypeScript application code effectively. How can I segregate my code into meaningful .ts chunks comprising pertinent classes, which can ultimately compile into a consolidated .js file that can be obfuscated successfully? Should I utilize references, exports, imports, or opt for a specific module type?
Thank you for your assistance in advance.