Skip to content

Commit 858f2e3

Browse files
committed
perf directory
1 parent 8c8fc44 commit 858f2e3

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

astro.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,23 @@ export default defineConfig({
107107
adapter: vercel(),
108108
vite: {
109109
plugins: [yaml()],
110+
build: {
111+
cssCodeSplit: true,
112+
rollupOptions: {
113+
output: {
114+
manualChunks(id) {
115+
// Split CCIP-specific styles into separate chunks
116+
if (id.includes("src/components/CCIP") && id.endsWith(".css")) {
117+
return "ccip-styles"
118+
}
119+
// Keep tooltip styles separate as they're not critical
120+
if (id.includes("tooltip-override")) {
121+
return "tooltip-styles"
122+
}
123+
},
124+
},
125+
},
126+
},
110127
},
111128
legacy: {
112129
collections: false,

src/components/HeadCommon.astro

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@ const { title } = Astro.props
2222

2323
<link rel="sitemap" href="/sitemap-index.xml" />
2424

25-
<!-- Scrollable a11y code helper -->
26-
<script src="/make-scrollable-code-focusable.js" is:inline></script>
25+
<!-- Preconnect to speed up external resource loading -->
26+
<link rel="preconnect" href="https://d2f70xi62kby8n.cloudfront.net" crossorigin />
27+
<link rel="dns-prefetch" href="https://d2f70xi62kby8n.cloudfront.net" />
28+
<link rel="preconnect" href="https://js.hs-analytics.net" crossorigin />
29+
<link rel="preconnect" href="https://js.hscollectedforms.net" crossorigin />
30+
<link rel="preconnect" href="https://js.usemessages.com" crossorigin />
31+
32+
<!-- Scrollable a11y code helper - defer to not block render -->
33+
<script src="/make-scrollable-code-focusable.js" defer></script>
2734

2835
<!-- Google Tag Manager -->
2936
<script type="text/javascript">

0 commit comments

Comments
 (0)