-
Notifications
You must be signed in to change notification settings - Fork 2
Loading with async or defer #12
Copy link
Copy link
Open
Description
= javascript_include_tag 'application', async: Rails.env.production?
css:
#{CriticalPathCss.fetch(request.path)}
javascript:
loadCSS("#{stylesheet_path('application')}");
link as="style" href="#{stylesheet_path('application')}" onload="this.rel='stylesheet'" rel="preload" /
noscript
link href="#{stylesheet_path('application')}" rel="stylesheet" /If I load application.js async in production, and I require the loadCSS function in application.js, won't there be a chance it won't have loaded by the time the critical-path-css-rails is executed?
What's the most performant way to handle this use case?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels