I have a very simple program to learn how to work with TypeScript, I bundled all my .ts
files using Browserify to make it possible to run inside the browser.
How to design API of my library in TypeScript? (any good resource)
Really a build tool chain question. If you want to expose your library as a global the answer is dependent on your toolchain. I recommend using webpack
. Here is a a sample config:
module.exports = {
/** Build from built js file */
entry: {
typestyle: './lib/index.js',
},
output: {
filename: './umd/typestyle.js',
libraryTarget: 'umd',
/** The library name on window */
library: 'typestyle'
}
};
From the TypeStyle project.