我将 systemjs-builder 与 angular2 一起使用。
我想要每个模块文件的构建器捆绑文件。
例如:我的结构如下
Main.ts
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './AppModule';
AppModule.ts
import {NgModule, CUSTOM_ELEMENTS_SCHEMA, ErrorHandler} from "@angular/core";
import {CommonModule, LocationStrategy, HashLocationStrategy} from "@angular/common";
import {appRoutingProviders, routing} from "./Routes";
import {LoginComponent} from "./components/user/LoginComponent";
import {ErrorComponent} from "./components/common/errorPage/ErrorComponent";
Routes.ts
{path: "accounts",loadChildren: 'app/components/account/AccountModule#AccountModule'},
{path: "contacts",loadChildren: 'app/components/contact/ContactModule#ContactModule'}
现在我曾经 builder.bundle('[app/**/*]',bundle.js)
将所有组件构建到一个文件中,所以大小非常大。
我想将Main.ts
(AppModule.ts,AppModule 中的所有组件......)额外库(angular2/core......)中的所有依赖项构建到“bundle.js”。
以及to 的所有依赖项, AccountModule
toAccountModule.js
的所有依赖ContactModule
项ContactModule.js
。
在生产中使用延迟加载。
这个问题的任何解决方案,谢谢