Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 17, 2024. It is now read-only.

AngularClass/angular-bootloader

Repository files navigation

Angular 2 Fundamentals


Angular 2 Bootloader

Angular 2 Bootloader for async script tag and hmr support

Why do I need async tag 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%

czkf6kfviaamqm6

Install

npm install @angularclass/bootloader --save

main.module.ts

import { bootloader } from '@angularclass/bootloader';
@NgModule({
 // ...
})
export class MainModule {}
export function main() {
 return platformBrowserDynamic().bootstrapModule(MainModule);
}
bootloader(main); // this will bootstrap your app via main function

index.html

<script async src="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



AngularClass ##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

About

⏩ Angular 2 (and Angular 4) Bootloader for async script tag and hmr support via @AngularClass

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

AltStyle によって変換されたページ (->オリジナル) /