*/
const AssetsPlugin = require('assets-webpack-plugin')
+const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin')
const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin')
const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin')
disabled: !AOT,
tsConfig: helpers.root('tsconfig.webpack.json'),
resourceOverride: helpers.root('config/resource-override.js')
+ }),
+
+ new BundleAnalyzerPlugin({
+ // Can be `server`, `static` or `disabled`.
+ // In `server` mode analyzer will start HTTP server to show bundle report.
+ // In `static` mode single HTML file with bundle report will be generated.
+ // In `disabled` mode you can use this plugin to just generate Webpack Stats JSON file by setting `generateStatsFile` to `true`.
+ analyzerMode: 'static',
+ // Path to bundle report file that will be generated in `static` mode.
+ // Relative to bundles output directory.
+ reportFilename: 'report.html',
+ // Automatically open report in default browser
+ openAnalyzer: false,
+ // If `true`, Webpack Stats JSON file will be generated in bundles output directory
+ generateStatsFile: true,
+ // Name of Webpack Stats JSON file that will be generated if `generateStatsFile` is `true`.
+ // Relative to bundles output directory.
+ statsFilename: 'stats.json',
+ // Options for `stats.toJson()` method.
+ // For example you can exclude sources of your modules from stats file with `source: false` option.
+ // See more options here: https://github.com/webpack/webpack/blob/webpack-1/lib/Stats.js#L21
+ statsOptions: null,
+ // Log level. Can be 'info', 'warn', 'error' or 'silent'.
+ logLevel: 'info'
})
],
"add-asset-html-webpack-plugin": "^1.0.2",
"codelyzer": "2.0.0-beta.4",
"standard": "^8.0.0",
+ "webpack-bundle-analyzer": "^2.2.1",
"webpack-dll-bundles-plugin": "^1.0.0-beta.5"
}
}
const adminRoutes: Routes = [
{
- path: 'admin',
+ path: '',
component: AdminComponent,
children: [
{
import { RequestsComponent, RequestStatsComponent, RequestService } from './requests';
import { UsersComponent, UserAddComponent, UserListComponent, UserService } from './users';
import { VideoAbusesComponent, VideoAbuseListComponent } from './video-abuses';
-import { MenuAdminComponent } from './menu-admin.component';
import { SharedModule } from '../shared';
@NgModule({
UserListComponent,
VideoAbusesComponent,
- VideoAbuseListComponent,
-
- MenuAdminComponent
+ VideoAbuseListComponent
],
exports: [
- AdminComponent,
- MenuAdminComponent
+ AdminComponent
],
providers: [
export * from './admin-routing.module';
export * from './admin.module';
export * from './admin.component';
-export * from './menu-admin.component';
path: '',
redirectTo: '/videos/list',
pathMatch: 'full'
+ },
+ {
+ path: 'admin',
+ loadChildren: './+admin#AdminModule'
}
];
import { AppState } from './app.service';
import { AccountModule } from './account';
-import { AdminModule } from './admin';
import { CoreModule } from './core';
import { LoginModule } from './login';
import { SharedModule } from './shared';
MetaModule.forRoot(metaConfig),
AccountModule,
- AdminModule,
CoreModule,
LoginModule,
SharedModule,
import { RouterModule } from '@angular/router';
import { AuthService } from './auth';
-import { MenuComponent } from './menu';
+import { MenuComponent, MenuAdminComponent } from './menu';
import { throwIfAlreadyLoaded } from './module-import-guard';
@NgModule({
HttpModule,
RouterModule
],
- declarations: [ MenuComponent ],
- exports: [ MenuComponent ],
+ declarations: [
+ MenuComponent,
+ MenuAdminComponent
+ ],
+ exports: [
+ MenuComponent,
+ MenuAdminComponent
+ ],
providers: [ AuthService ]
})
export class CoreModule {
export * from './menu.component';
+export * from './menu-admin.component';