Updating to Angular 12 is messing up my EJS

132 Views Asked by At

I have this piece of code in my index.html that includes EJS in the head:

<%= (@meta_tags || {}).each do |name, val| %>
  <meta name="<%= name %>" content="<%= val %>">
<%= end %>
<title>Dashboard</title>
<%= favicon %>
<%= csrf_meta_tag %>
<%= stylesheet_link_tag "https://fonts.googleapis.com/css?family=Lato:300,400,400i,700|Oswald:400,500&display=swap"%>
<%= stylesheet_link_tag current_stylesheet_url %>

Until Angular 11 it was compiling perfect. After I recently updated to Angular 12, this is what I'm getting in the public/index.htm file:

</head><body>&lt;%= (@meta_tags || {}).each do |name, val| %&gt;
<meta name="<%= name %>" content="<%= val %>">
&lt;%= end %&gt;
<title>Dashboard</title>
&lt;%= favicon %&gt;
&lt;%= csrf_meta_tag %&gt;
&lt;%= stylesheet_link_tag "https://fonts.googleapis.com/css?family=Lato:300,400,400i,700|Oswald:400,500&amp;display=swap"%&gt;
&lt;%= stylesheet_link_tag current_stylesheet_url %&gt;

These are my angular compiler options:

         "configurations": {
            "production": {
              "budgets": [
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "6kb"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": true,
              "namedChunks": true,
              "aot": true,
              "buildOptimizer": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]
            }

What configuration am I missing so that I can correctly compile my EJS in the index.html file again as I was normally doing in previous versions of angular? Thanks!

0

There are 0 best solutions below