Angular-cli: ng build Library --aot --prod

Created on 23 Nov 2018  路  3Comments  路  Source: angular/angular-cli

I create a library by command('ng generate library my-library').
use 'ng build my-library' and work successful.
but use 'ng build my-library --prod --aot', not work.
please help me.

Most helpful comment

Angular CLI no longer creates a production for libraries, as there is a single ng-packagr configuration. Since previously two different confiurations were dist folder was kept for none --prod builds.

Unless you create a production configuration you shouldn't be needing --prod for libraries.

Libraries get only build in AOT mode, thus 鈥攁ot is not available.

All 3 comments

The ng build command with the --prod meta-flag (ng build --prod) compiles with AOT by default.

Refer: Doc

Angular CLI no longer creates a production for libraries, as there is a single ng-packagr configuration. Since previously two different confiurations were dist folder was kept for none --prod builds.

Unless you create a production configuration you shouldn't be needing --prod for libraries.

Libraries get only build in AOT mode, thus 鈥攁ot is not available.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings