在“ng build --prod”之后找不到模块

时间:2016-09-23 20:08:31

标签: angular build routes production-environment angular-cli

执行ng build --prod后,我无法打开子模块(延迟加载)。

market.module.js不是由构建生成的。

错误:

zone.js:1263 GET http://192.168.1.10/dist/app/+market/market.module.js 404 (Not Found)

环境:

angular-cli: 1.0.0-beta.10
node: 6.3.1
os: linux x64

app.routing.ts:

import { ModuleWithProviders }  from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { ModuleWithProviders }  from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { AppComponent } from './app.component';
import { CompanyGuard } from './shared/guards/company.guard';

const appRoutes: Routes = [
    {
        path: 'company/:company_id',
        children: [
            {
                path: 'market',
                loadChildren: 'app/+market/market.module#MarketModule',
            }
        ],
        canActivate: [ CompanyGuard ]
    }
];

export const appRoutingProviders: any[] = [

];

export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);

0 个答案:

没有答案