feat: Add typed routing
Some checks failed
Build, check & Test / run (push) Failing after 1m40s

Signed-off-by: Avior <github@avior.me>
This commit is contained in:
2023-11-11 14:09:56 +01:00
parent f112ac6b50
commit b4e122b617
3 changed files with 268 additions and 66 deletions

View File

@ -1,33 +1,34 @@
import { defineConfig } from 'astro/config'
import tailwind from "@astrojs/tailwind"
import node from "@astrojs/node"
// const faviconHook = {
// name: 'Favicon',
// hooks: {
// "astro:build:setup": async () => {
// await Manifest.create('./src/assets/favicon.png', {
// name: 'Template'
// })
// }
// }
// }
// https://astro.build/config
export default defineConfig({
import { defineConfig } from 'astro/config'
import tailwind from "@astrojs/tailwind"
import node from "@astrojs/node"
import routing from './hooks/routing'
// const faviconHook = {
// name: 'Favicon',
// hooks: {
// "astro:build:setup": async () => {
// await Manifest.create('./src/assets/favicon.png', {
// name: 'Template'
// })
// }
// }
// }
// https://astro.build/config
export default defineConfig({
// Use the NodeJS adapter
adapter: node({
mode: "standalone"
}),
// some settings to the build output
build: {
build: {
// the asset path
assets: 'assets',
assets: 'assets',
// inline the stylesheet if it is small enough
inlineStylesheets: 'auto'
},
inlineStylesheets: 'auto'
},
// Compress the HTML output
compressHTML: true,
@ -36,7 +37,7 @@ export default defineConfig({
output: 'server',
// Add TailwindCSS
integrations: [tailwind()],
integrations: [tailwind(), routing()],
// prefetch links
prefetch: {
@ -47,25 +48,25 @@ export default defineConfig({
site: 'https://example.com',
// the Output server
server: {
host: true,
port: 3000
},
server: {
host: true,
port: 3000
},
// Remove the trailing slash by default
trailingSlash: 'never',
trailingSlash: 'never',
// Dev Server
vite: {
server: {
watch: {
vite: {
server: {
watch: {
// Ignore some paths
ignored: [],
// support WSL strange things
usePolling: !!process.env.WSL_DISTRO_NAME
}
}
},
// support WSL strange things
usePolling: !!process.env.WSL_DISTRO_NAME
}
}
},
})
})