In Angular using preserveWhitespaces flag we can perserving whitespaces. We can use this in 2 places. either main.ts nor tsconfig.json
main.ts
platformBrowserDynamic().bootstrapModule(AppModule, { preserveWhitespaces: false });
tsconfig.json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"baseUrl": "./",
"module": "es2015",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
],
"angularCompilerOptions": {
"preserveWhitespaces": false
}
}