How can I properly replace/rename Angular index.html file to index.php?

one text

Solution:

This behaviour seems to be a bug. It's caused by a CSS optimizer. Disabling the inlineCritical fixes the issue (see https://angular.io/guide/workspace-config#styles-optimization-options).

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "fubar": {
      "projectType": "library",
      ...
    },
    "acme": {
      "projectType": "application",
      "schematics": { ... },
      ...
      "architect": {
        "build": {
          ...
          "configurations": {
            "production": {
              ...
              "optimization": {  <-- ADDING THIS HAS SOLVED THE ISSUE FOR ME.
                "styles": {
                  "inlineCritical": false
                }
              }
            },
            "development": {
              ...
            }
          },
          "defaultConfiguration": "..."
        },
        "serve": {
          ...
        },
        "extract-i18n": {
          ...
        },
        "test": {
          ...
        }
      }
    }
  },
  "defaultProject": "acme"
}

It's important to note the difference in build time which indicate that the optimization that got disabled was not a trivial task.

enter image description here

Source