Skip to content

Create React App removes SSI directives on Build from index.html #4556

Description

@ngyangjo

I'm trying to add some SSI directives in the index.html so that I can return dynamic meta tags based on the current url. I'm doing this to solve the Facebook Meta Tag issue. Below is the snippet of the if-condition I've added in the index.html.

<!--#if expr="$DOCUMENT_URI = /movie-review\/(.*)/" -->

But, realized that the create-react-app seems to delete them on build. The final built index.html is minified and does not have any comments on them. Since SSI directives syntax is similar to html comments, create-react-app is removing them. Is there any way to skip removing them on build? If no, then what other possible solutions exist to solve the dynamic meta tag problem for react app served on apache server?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions