尝试使用 构建我的应用程序时ng-build
,出现以下错误:
试图找到引导代码,但找不到。指定静态可分析的引导代码或将 entryModule 传递给插件选项。
中指定的我的主文件.angular-cli.json
非常简单:
import { NgModule } from '@angular/core';
import { LoginComponent } from './login.component';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
import { HttpClientModule } from '@angular/common/http';
import { LoginService } from '../login.service'
@NgModule({
declarations: [
LoginComponent
],
imports: [
BrowserModule,
FormsModule,
HttpClientModule
],
providers: [LoginService],
bootstrap: [LoginComponent]
})
export class AppModule { }
platformBrowserDynamic().bootstrapModule(AppModule);
ng --version
返回以下内容:
Angular CLI: 1.7.0
Node: 6.11.0
OS: win32 x64
Angular: 5.2.5
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic
@angular/cli: 1.7.0
@angular-devkit/build-optimizer: 0.3.1
@angular-devkit/core: 0.3.1
@angular-devkit/schematics: 0.3.1
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.0
@schematics/angular: 0.3.1
@schematics/package-update: 0.3.1
typescript: 2.7.2
webpack-replace: 1.0.0
webpack-vendor-chunk-plugin: 1.0.0
webpack: 3.11.0