46 lines
979 B
TypeScript
46 lines
979 B
TypeScript
import { execFileSync } from 'node:child_process'
|
|
|
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
const prerenderRoutes = JSON.parse(
|
|
execFileSync('node', ['scripts/generate-prerender-routes.mjs'], {
|
|
cwd: process.cwd(),
|
|
encoding: 'utf-8'
|
|
})
|
|
) as string[]
|
|
|
|
export default defineNuxtConfig({
|
|
compatibilityDate: '2025-07-15',
|
|
devtools: { enabled: true },
|
|
ssr: true,
|
|
modules: [
|
|
'@nuxt/content',
|
|
'@nuxt/image',
|
|
'@nuxtjs/sitemap',
|
|
'@nuxtjs/robots',
|
|
'@vueuse/nuxt'
|
|
],
|
|
css: ['~/assets/styles/main.css'],
|
|
site: {
|
|
url: 'https://example.com'
|
|
},
|
|
app: {
|
|
head: {
|
|
charset: 'utf-8',
|
|
viewport: 'width=device-width, initial-scale=1',
|
|
title: 'AgWeb Nuxt Migration',
|
|
link: [
|
|
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
|
|
]
|
|
}
|
|
},
|
|
routeRules: {
|
|
'/**': { prerender: true }
|
|
},
|
|
nitro: {
|
|
prerender: {
|
|
crawlLinks: true,
|
|
routes: prerenderRoutes
|
|
}
|
|
}
|
|
})
|