This starter lays out a project structure for libraries that are to be consumed by Angular. It will output files that correspond to the Angular Package Format.
- FESM (Flat ECMAScript Module) with ES5 code
- FESM with ES2015 code
- TSLint
- Prettier
- Should work on Windows/Linux/Mac
- Code can be consumed by AOT
- Tree Shakeable
- Support for Closure Compiler
- Unit testing and code coverage with Jest
- Basic CircleCI 2.0 config
All of the code inside of src
will be bundled up for you automatically. The entry point for the end package is src/index.ts
. All files that are to be included must be part of that entry point.
Of course, you will probably not want to have angular-library-starter
be your package name. Change it to your own library name in the following places:
package.json
name
module
pathes2015
pathtypings
path
tsconfig.json
andtsconfig.es2015.json
angularCompilerOptions
flatModuleOutFile
flatModuleId
Any packages that you include in your peerDependencies
will not be included in your published bundle automatically.
This repo has been designed to be published on npm. It is recommended to use the procedure described here. For release note tracking, it is recommended to use GitHub's releases feature due to the extra niceties that come along with it (easy release note management, automatic source code bundling, etc.)
npm run build
: Run through the entire build processnpm run lint
: Runs all lintersnpm run prettify
: Runs prettier over the entire codebasenpm test
: Runs the unit test suite with code coveragenpm run test:watch
: Runs the unit test suite in watch modenpm run clean
: Removes build artifacts