更新到Angular 12正在弄乱我的EJS

发布于 2025-01-21 15:32:00 字数 1876 浏览 3 评论 0原文

代码。

<%= (@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 %>

我的索引中有这个 最近我更新到Angular 12之后,这就是我在public/index.htm文件中得到的内容:

</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;

这些是我的角编译器选项:

         "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"
                }
              ]
            }

我缺少什么配置,以便我可以正确编译我的iNDEX.html文件中的EJS再次像我通常在Angular中一样? 谢谢!

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><%= (@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 %>

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文