加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.ts 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
kuzank 提交于 2020-01-18 11:18 . first commit
import { enableProdMode, ViewEncapsulation } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import { preloaderFinished } from '@delon/theme';
preloaderFinished();
import { hmrBootstrap } from './hmr';
if (environment.production) {
enableProdMode();
}
const bootstrap = () => {
return platformBrowserDynamic()
.bootstrapModule(AppModule, {
defaultEncapsulation: ViewEncapsulation.Emulated,
preserveWhitespaces: false,
})
.then(res => {
if ((window as any).appBootstrap) {
(window as any).appBootstrap();
}
return res;
});
};
if (environment.hmr) {
// tslint:disable-next-line: no-string-literal
if (module['hot']) {
hmrBootstrap(module, bootstrap);
} else {
console.error('HMR is not enabled for webpack-dev-server!');
console.log('Are you using the --hmr flag for ng serve?');
}
} else {
bootstrap();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化