Skip to content

Commit

Permalink
add prefetch at home page
Browse files Browse the repository at this point in the history
  • Loading branch information
g-plane committed May 20, 2020
1 parent 3e2ff83 commit ed73106
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/HomeController.php
Expand Up @@ -21,6 +21,7 @@ public function index(Webpack $webpack)
'home_page_css_loader',
config('app.asset.env') === 'development' ? $webpack->url('home.js') : null
)
->with('app_js', $webpack->url('app.js'))
->with('user_can_register', option('user_can_register'));
}

Expand Down
3 changes: 3 additions & 0 deletions resources/views/home.twig
Expand Up @@ -14,6 +14,9 @@
{% endif %}
}
</style>
<link rel="prefetch" as="script" href="https://cdn.jsdelivr.net/npm/react@16.13.1/umd/react.production.min.js" crossorigin="anonymous">
<link rel="prefetch" as="script" href="https://cdn.jsdelivr.net/npm/react-dom@16.13.1/umd/react-dom.production.min.js" crossorigin="anonymous">
<link rel="prefetch" as="script" href="{{ app_js }}" crossorigin="anonymous">
</head>

<body class="hold-transition layout-top-nav">
Expand Down

0 comments on commit ed73106

Please sign in to comment.