angular-bootloader
angular-bootloader copied to clipboard
Question: How to even use this?
I found this library while searching how to load my angular bundles with defer
attribute. Even async is fine for me.
After spending 2+ hours on this library, I have an absolute zero idea how to make it work. I tried it in fresh project but no success.
Repo: https://github.com/goodmite/bootloader-not-working
I Created a fresh project and in main.ts
did this. It did not work.
// platformBrowserDynamic().bootstrapModule(AppModule).catch(err => console.error(err))
export function main() {
return platformBrowserDynamic().bootstrapModule(AppModule);
}
bootloader(main); // this will bootstrap your app via main function
Result: No async scripts in index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AngularTest</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="styles.3ff695c00d717f2d2a11.css"></head>
<body>
<app-root></app-root>
<script type="text/javascript" src="runtime.3ad3e88387299ab1fa63.js"></script><script type="text/javascript" src="polyfills.e254f6b9bf511460eb6d.js"></script><script type="text/javascript" src="main.f6e46af22b8eab9da529.js"></script></body>
</html>
I have a few questions. All of these would be automatically answered if you could provide one basic repo which uses this library.
- How to use this? What is the
MainModule
in the ReadMe? Is it the root module or the feature module? I tried loading both withbootloader
. No success. - Does this work in angular cli projects?
- Does this work in projects which don't implement angular universal. I ask this because all of the tutorials for this library are in the context of angular universal.