Skip to content

Commit

Permalink
perf: defer loading scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainLanz committed Jan 28, 2024
1 parent 0fb74e9 commit 5162797
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions config/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ const viteBackendConfig = defineConfig({
* point to a CDN in production.
*/
assetsUrl: '/assets',

scriptAttributes: {
defer: true,
},
})

export default viteBackendConfig
2 changes: 1 addition & 1 deletion resources/views/app_root.edge
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">

<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.3.0/model-viewer.min.js"></script>
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.3.0/model-viewer.min.js" defer></script>
@vite(['resources/app.ts'])
</head>

Expand Down

0 comments on commit 5162797

Please sign in to comment.