-
Remove
.git
folder from the root dir. This is important if you checkout the source code from a repository because you are going to create your own library.$ rm -R .git
-
Replace all
ngx-library-template
text references in files withyour-own-package-name
:- README.md
- package.json
- .angular-cli.json
- src/app/app.module.ts
- src/lib/package.json
- src/lib/tsconfig.es5.json
- src/tsconfig.app.json
-
Run npm install
$ npm install
-
Remove this steps from the README and complete the library details
-
Read development notes and build/run notes below
Important: If your IDE lints ngx-library-template
as not found module, ignore this warning.
This library will be loaded as it is configured in paths
option in src/tsconfig.app.json
This project was built using angular-cli scaffolding and generator-angular2-library rollup-build system
NOTE: REMOVE ABOVE DOC BEFORE PUBLISHING YOUR OWN LIBRARY...
https://edriang.github.io/ngx-library-template/dist-demo/
To install this library, run:
$ npm install ngx-library-template --save
Important: Also check that listed peerDependencies
on package.json
are installed into your project
TODO...
See Demo project, under src/app
folder
$ npm run start
- Lib sources are under
src/lib
- Demo sources are under
src/app
Important: The sources to be packaged and compiled are the ones listed in src/lib/index.ts
or any of its dependencies
To create dist-lib
bundle (dist of the lib app) run:
$ npm run build-lib
To create dist-demo
bundle (dist of the demo app) run:
$ npm run build
To publish cd dist-demo
and npm publish
Important: this project uses two package.json
files. One, in the root folder, is for defining dependencies to run and build the code and else dependencies used by the demo project. Dependencies of the lib must be configured under src/lib/package.json
as well as info of the lib itself (name, version, etc)
MIT © Adrian Gallardo