use standard environments

This commit is contained in:
William Welling
2021-12-04 10:37:56 -06:00
parent c1555326fa
commit 71f5b46639
30 changed files with 963 additions and 861 deletions

View File

@@ -1,22 +1,25 @@
import 'zone.js/dist/zone';
import 'reflect-metadata';
import 'core-js/es/reflect';
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { bootloader } from '@angularclass/bootloader';
import { load as loadWebFont } from 'webfontloader';
import { hasValue } from './app/shared/empty.util';
import { BrowserAppModule } from './modules/app/browser-app.module';
import { environment } from './environments/environment';
// import { AppConfig, APP_CONFIG } from './config/app-config.interface';
// import { extendEnvironmentWithAppConfig } from './config/config.util';
if (environment.production) {
enableProdMode();
}
export function main() {
const main = () => {
// Load fonts async
// https://github.com/typekit/webfontloader#configuration
loadWebFont({
@@ -25,13 +28,23 @@ export function main() {
}
});
return platformBrowserDynamic().bootstrapModule(BrowserAppModule, {preserveWhitespaces:true});
}
return platformBrowserDynamic()
.bootstrapModule(BrowserAppModule, {
preserveWhitespaces: true
});
};
// support async tag or hmr
if (hasValue(environment.universal) && environment.universal.preboot === false) {
bootloader(main);
main();
} else {
document.addEventListener('DOMContentLoaded', () => bootloader(main));
document.addEventListener('DOMContentLoaded', main);
}
// fetch('assets/appConfig.json')
// .then((response) => response.json())
// .then((appConfig: AppConfig) => {
// // extend environment with app config for client side use
// extendEnvironmentWithAppConfig(environment, appConfig);
// });