feat: prefetch pages for better navigation

This commit is contained in:
iCrawl
2022-10-09 01:03:44 +02:00
parent 1b4f69b00a
commit 32297d4717
3 changed files with 23 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import { fileURLToPath, URL } from 'node:url';
import image from '@astrojs/image';
import mdx from '@astrojs/mdx';
import prefetch from '@astrojs/prefetch';
import react from '@astrojs/react';
import { remarkCodeHike } from '@code-hike/mdx';
import { defineConfig } from 'astro/config';
@@ -49,6 +50,9 @@ export default defineConfig({
image({
serviceEntryPoint: '@astrojs/image/sharp',
}),
prefetch({
throttle: 3,
}),
Unocss({
configFile: fileURLToPath(new URL('../ui/unocss.config.ts', import.meta.url)),
}),

View File

@@ -40,7 +40,6 @@
"@code-hike/mdx": "^0.7.4",
"@discordjs/ui": "workspace:^",
"ariakit": "^2.0.0-next.41",
"astro": "^1.4.6",
"cmdk": "^0.1.20",
"meilisearch": "^0.28.0",
"react": "^17.0.2",
@@ -52,6 +51,7 @@
"shiki": "^0.11.1"
},
"devDependencies": {
"@astrojs/prefetch": "^0.0.8",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/node": "^16.11.64",
@@ -62,6 +62,7 @@
"@unocss/reset": "^0.45.28",
"@vitejs/plugin-react": "^2.1.0",
"@vitest/coverage-c8": "^0.24.0",
"astro": "^1.4.6",
"astro-compress": "^1.0.11",
"astro-critters": "^1.0.5",
"cross-env": "^7.0.3",