You can read generally about the module specifications here, for full browser support you’d need to use a bundler like Parcel, Webpack, Rollup, etc.
TypeScript adds a namespace keyword which is essentially just syntax sugar that compiles to JavaScript modules namespaced via the ES6 module system, or if you need full browser support and are compiling to ES5, it’ll compile to a method similar to what you’ve shown above. You can read more about TypeScript namespaces here
Mat - Do you have to use a bundler, or just go through some sort of server? I understood the latter, but not tried it w/o a bundler so I can't say for sure. Once it gets out of the bundler, it probably won't be a module anyway.
Also, where did you get your user pic here? I've been looking to create one of my own & I like that style.
You can read generally about the module specifications here, for full browser support you’d need to use a bundler like Parcel, Webpack, Rollup, etc.
TypeScript adds a
namespace
keyword which is essentially just syntax sugar that compiles to JavaScript modules namespaced via the ES6 module system, or if you need full browser support and are compiling to ES5, it’ll compile to a method similar to what you’ve shown above. You can read more about TypeScript namespaces hereThanks for your time and references
Mat - Do you have to use a bundler, or just go through some sort of server? I understood the latter, but not tried it w/o a bundler so I can't say for sure. Once it gets out of the bundler, it probably won't be a module anyway.
Also, where did you get your user pic here? I've been looking to create one of my own & I like that style.
In an environment that supports ES6 natively (so, Node.js Server, Chrome, or Firefox) you don’t need a bundler, you can use ES6 modules natively.
Also, here