1

I asking my first Angular-related question. Please bear with me if it has already been answered. Hopefully, you know the answer and have time to share it. 🙏🏽

My current use case is the following:

  1. After building the Angular app, the default page must be index.php (I have that currently working)
  2. The index.php file contains a PHP logic which is required for various things. For the sake of simplicity, let's assume that the PHP logic needs to inject a special dynamic metatag in the HTML . Values for that metatag are inherited from a parent non-Angular app (a plain old-fashioned CMS).
  3. I am using the latest Angular version.

My current issue:

Whenever I run ng build, PHP tags in my index.php file get converted from <?php ... ?> to <--?php ... ?-->.

Questions

  1. Why is this happening?
  2. Is there any way to configure this behaviour?

Many thanks in advance. I appreciate any answers.

1 Answer 1

0

According to this SO Post, a CSS optimizer causes that potential bug. The solution is to disable inlineCritical like this:

Add this option in angular.json, in each build/configuration :

"optimization": {
            "styles": {
              "inlineCritical": false
            }
          }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.