<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>

    <style>
      <% components = config.components_in_route('index') %>
      <% components.map { |(component, data)| component if data['critical'] }.compact.each do |component| %>
        <%= env["components/#{component}.css"] %>
      <% end %>
    </style>

    <script>
      <%= env['lazy.js'] %>
    </script>

    <noscript>
      <link rel="stylesheet" href="/assets/application.css" />
    </noscript>
  </head>
  <body>
    <div class="page">
      <div class="page__content">
        <%= yield %>
      </div>
    </div>

    <script src="/assets/app.js" defer></script>
  </body>
</html>

<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>

    <style>
      <%= env['critical.css'] %>
      <% components = config.components_in_route('index') %>
      <% components.map { |(component, data)| component if data['critical'] }.compact.each do |component| %>
        <%= env["components/#{component}.css"] %>
      <% end %>
    </style>

    <script>
      <%= env['lazy.js'] %>
    </script>

    <noscript>
      <link rel="stylesheet" href="/assets/application.css" />
    </noscript>
  </head>
  <body>
    <div class="page">
      <div class="page__content">
        <%= yield %>
      </div>
    </div>

    <script src="/assets/app.js" defer></script>
  </body>
</html>

Add critical.css (shared components) back to embedded css
Add critical.css (shared components) back to embedded css