Skip to content

Commit 2e7eb6f

Browse files
ishitatsuyukidond2clouds
authored andcommitted
feat(@angular/cli): add support for minifying HTML
Close angular#1861
1 parent cd4c6cd commit 2e7eb6f

File tree

1 file changed

+6
-1
lines changed
  • packages/@angular/cli/models/webpack-configs

1 file changed

+6
-1
lines changed

packages/@angular/cli/models/webpack-configs/browser.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ export function getBrowserConfig(wco: WebpackConfigOptions) {
4949
filename: path.resolve(buildOptions.outputPath, appConfig.index),
5050
chunksSortMode: packageChunkSort(appConfig),
5151
excludeChunks: lazyChunks,
52-
xhtml: true
52+
xhtml: true,
53+
minify: buildOptions.target === 'production' ? {
54+
caseSensitive: true,
55+
collapseWhitespace: true,
56+
keepClosingSlash: true
57+
} : false
5358
}),
5459
new BaseHrefWebpackPlugin({
5560
baseHref: buildOptions.baseHref

0 commit comments

Comments
 (0)