- Use typescript compiler to compile your library into:
lib
directory for commonjs code to consumelib-esm
directory for es2015 code to consume
- Use webpack version 4 to bundle the code into:
bundle
directory as an UMD module for others
- Setup npm scripts for easy build
npm run dev
to compile to above directoriesnpm run dev:watch
to watch the file changes (by nodemon) and run the build scriptnpm run build
to 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