title: ng build does not include component class code of library modules
body: <p>I have created a library that has modules that have components in them.</p>
  
  <p>My library public_api.ts has this:</p>
  
  <pre><code>export * from './src/app/modules/my-mod-1/my-mod-1.module';
  </code></pre>
  
  <p>Now this module has components that are exported and declared in the module.ts file</p>
  
  <pre><code>@NgModule({
      imports:      [
          ...
      ],
      declarations: [
          MyOneComponent
      ],
      exports:      [
          MyOneComponent
      ]
  })
  </code></pre>
  
  <p>Now I create the package using ng-packagr and import it in another project using npm install from the .tgz file.</p>
  
  <p>The component works fine with all lifecycle hooks when I run it in development mode.</p>
  
  <p>But when I create a build using <code>ng build</code>, it does not call the lifecycle hooks. Although it does print everything in the html file of the component, but the component class code seems to be missing.</p>
  
  <p>I checked in <code>vendor.js</code> file when running the development mode, and there I can easily find the component class code (actually I searched for a console.log code that I printed in the component class code and it was showing up there)</p>
  
  <p>But same code is missing from main.xxxxxx.js that is built by the build command. And the build command does not create a vendor.js file at all because vendor.js is included in main.js</p>
  
  <p><strong>So the problem is that library classes code is not included in the project build, why would that happen?</strong></p>
  
  <p>There is so much code in the projects that I cannot think of what parts of code should I paste here to help you understand the issue. So please do let me know what else I should copy here.</p>
  
  <p>Thanks</p>