title: Angular - Use a Barrel File for all Component Imports
body: <p>I am currently on Angular 5.</p>
  
  <p>I have created a barrel file for all the common imports I use in my component files.  <strong>The question that I have is - is this a good idea or bad idea in regards to lazy loading, tree shaking, or anything else I didn't think of such as AOT?</strong>  Or is this approach completely fine and won't affect load time or anything else negatively.  If you could shine some light on the reason too that would be appreciated. </p>
  
  <p>Examples: </p>
  
  <pre><code>  common-component-imports.ts:
      export { AppState, Event, EventPriority, EventType, Page, Unit, User, WindowSettings } from '../models/index';
      export { Component, ElementRef, Input, ViewChild, ViewChildren } from '@angular/core';
      export { Config, IonicPage, Loading, LoadingController, Modal, ModalController, Nav, NavController, NavParams, Platform, Toast, ToastController, ViewController } from 'ionic-angular';
  etc../
  </code></pre>
  
  <p>and than in my components I am doing this:</p>
  
  <pre><code>event.ts
  import {
    Component,
    ElectronService,
    Event,
    AppState,
    IonicPage,
    NavController,
    NavParams,
    Store,
   } from '../shared/common-component-imports';
  </code></pre>
  
  <p>and I import like that on several more files besides just event.ts.</p>