This is a repo that setup the basic structure for my (and your) next typescript library. Simply fork it and start coding!
- Use typescript compiler to compile your library into:
libdirectory for commonjs code to consumelib-esmdirectory for es2015 code to consume
- Use webpack version 4 to bundle the code into:
bundledirectory as an UMD module for others
- Setup npm scripts for easy build
npm run devto compile to above directoriesnpm run dev:watchto watch the file changes (by nodemon) and run the build scriptnpm run buildto generate minimized code for publish
- Refer to tslint config for tslint configuration details
- Refer to nodemon config for nodemon configuration sample
- Refer to webpack config for webpack configuration details
Inspired by the awesome blog post Compiling and bundling TypeScript libraries with Webpack by Marco Botto