mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-24 08:06:17 +08:00
With this change we inline Google fonts and icons in the index html file when optimization is enabled. **Before** ```html <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> ``` **After** ```html <style> @font-face { font-family: 'Material Icons'; font-style: normal; font-weight: 400; src: url(https://fonts.gstatic.com/s/materialicons/v55/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2) format('woff2'); } .material-icons { font-family: 'Material Icons'; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr; } </style> ``` To opt-out of this feature set `optimization.fonts: false` or `optimization.fonts.inline: false` in the browser builder options. Example: ```js "configurations": { "production": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "optimization": { "fonts": false }, ``` More information about the motivation for this feature can be found: https://github.com/angular/angular-cli/issues/18730 Note: internet access is required during the build for this optimization to work.