I'm trying to create an application in Electron and I'd like to use Typescript for this. Knowing Typescript just boils down to JavaScript in the end, thats no problem, and having used TypeScript before, that "just works".
My scenario at the moment is I'm trying to create a single, monolithic .js file from the TypeScript (using the outFile setting), but separating my .ts code a little into files containing classes (namespaced where appropriate).
I know I can use the references in TypeScript and using the namespace keyword to break apart my code into sensible chunks. I've also been using "export class" to give me access to what I need. However, I walk into a problem whenever I want to import fs or lodash. Then start getting all kinds of errors about "define is not defined". So, I try and import AMD loader or RequireJS, but none of this seems to work.
I then read that I shouldn't mix Internal and External modules together in TypeScript 1.8.
So, the big question is.. how should I layout my application code in TypeScript... How do I separate out my code sensibly into .ts chunks containing sensible classes which compile into a single .js file that I can obfuscate successfully? Using references? Exporting? Importing? Which module type?
Cheers in advance.