Angular 2 Bootloader for async script tag and hmr support
Chrome V8 parses script tags with <script async> or <script defer> on a separate thread once downloading of index.html begins. Initial load of your index.html improves by up to 10%
npm install @angularclass/bootloader --save
main.module.ts
import{bootloader}from'@angularclass/bootloader';
@NgModule({// ...})exportclassMainModule{}exportfunctionmain(){returnplatformBrowserDynamic().bootstrapModule(MainModule);}bootloader(main);// this will bootstrap your app via main functionindex.html
<scriptasyncsrc="app.bundle.js"></script>If you have a vendor file you can delete it and include async tag in your one app bundle
enjoy — AngularClass
Learn AngularJS, Angular 2, and Modern Web Development from the best. Looking for corporate Angular training, want to host us, or Angular consulting? patrick@angularclass.com


