diff --git a/packages/@angular/cli/models/webpack-configs/browser.ts b/packages/@angular/cli/models/webpack-configs/browser.ts index 11691a941612..b53a1eb3e4a9 100644 --- a/packages/@angular/cli/models/webpack-configs/browser.ts +++ b/packages/@angular/cli/models/webpack-configs/browser.ts @@ -60,11 +60,13 @@ export function getBrowserConfig(wco: WebpackConfigOptions) { })); } + const flatIndex = appConfig.index.substr(appConfig.index.lastIndexOf('/') + 1); + return { plugins: [ new HtmlWebpackPlugin({ template: path.resolve(appRoot, appConfig.index), - filename: path.resolve(buildOptions.outputPath, appConfig.index), + filename: path.resolve(buildOptions.outputPath, flatIndex), chunksSortMode: packageChunkSort(appConfig), excludeChunks: lazyChunks, xhtml: true,