From d3fda3ab9bf104da35e606273246632d322f26d1 Mon Sep 17 00:00:00 2001 From: Tatsuyuki Ishi Date: Thu, 30 Mar 2017 18:16:02 +0900 Subject: [PATCH] feat(@angular/cli): add support for minifying HTML Close #1861 --- packages/@angular/cli/models/webpack-configs/browser.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/@angular/cli/models/webpack-configs/browser.ts b/packages/@angular/cli/models/webpack-configs/browser.ts index b85670529389..8a75e34dafc7 100644 --- a/packages/@angular/cli/models/webpack-configs/browser.ts +++ b/packages/@angular/cli/models/webpack-configs/browser.ts @@ -37,7 +37,12 @@ export function getBrowserConfig(wco: WebpackConfigOptions) { filename: path.resolve(buildOptions.outputPath, appConfig.index), chunksSortMode: packageChunkSort(appConfig), excludeChunks: lazyChunks, - xhtml: true + xhtml: true, + minify: buildOptions.target === 'production' ? { + caseSensitive: true, + collapseWhitespace: true, + keepClosingSlash: true + } : false }), new BaseHrefWebpackPlugin({ baseHref: buildOptions.baseHref