angular-react icon indicating copy to clipboard operation
angular-react copied to clipboard

Support AOT compile component indivdually

Open shinnqy opened this issue 5 years ago • 1 comments

This PR do two things:

  • Support AOT can compile single component if is imported individually
    • Upgrade ng-packagr because current version doesn't support.
    • Add ng-package.json file in each component folder to indicate this is an entry
    • Change import way of files under @angular-react/fabirc, because ng-packagr forbid import files that is not under root dir, so need to import as third-party dependency
    • Change import way of office-ui-fabric-react to only import single component from office-ui-fabric-react
  • Shorten the path of @angular-react/fabric/src/lib/components to @angular-react/fabric/lib/components to make path cleaner

Recently, I'm working on apply this microsoft/angular-react to our project. But I find that if I just want to import single component in order to make sure the bundle size would not increase too much, but there is error when enable AOT compile for Production environment because currently this library did not generate *.metadata.json for each component.

New version of ng-packagr has supported to generate *.metadata.json for each component. So I upgrade it to v5.7.1, then apply it to Pivot and it works.

Now you can import this single component by: import { FabPivotModule } from '@angular-react/fabric/lib/components/pivot';

shinnqy avatar Sep 01 '20 08:09 shinnqy

CLA assistant check
All CLA requirements met.