Package Exports
- ng-packagr/lib/util/log
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ng-packagr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ng-packagr
Compile and package a TypeScript library to Angular Package Format
Usage Example
For an Angular library, create one configuration file ng-package.json
:
{
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
"lib": {
"entryFile": "public_api.ts"
}
}
Then, build the library from a npm/yarn script defined in package.json
:
{
"scripts": {
"build": "ng-packagr -p ng-package.json"
}
}
$ yarn build
Alternatively, build the library with the following command:
$ node_modules/.bin/ng-packagr -p ng-package.json
Pathes are resolved relative to the location of the ng-package.json
file.
The package.json
describing the library should be located in the same folder, next to ng-package.json
.
Features
- 🎁 Implements Angular Package Format
- 🏁 Bundles your library in FESM2015, FESM5, and UMD formats
- 🎒 npm package can be consumed by Angular CLI, Webpack, or SystemJS
- 💃 Creates type definitions (
.d.ts
) - 🏃 Generates Ahead-of-Time metadata (
.metadata.json
)
- 🏄 Inlines Templates and Stylesheets
- ✨ CSS Features
- 🐫 Runs SCSS preprocessor, supporting the relative
~
import syntax - 🐘 Runs less preprocessor
- 🐒 Adds vendor-specific prefixes w/ autoprefixer and browserslist — just tell your desired
.browserslistrc
- 🐫 Runs SCSS preprocessor, supporting the relative
Knowledge
Angular Package Format v4.0, design document at Google Docs
Packaging Angular - Jason Aden at ng-conf 2017 (28min talk):