nuxt初始化
This commit is contained in:
45
nuxt-web/nuxt.config.ts
Normal file
45
nuxt-web/nuxt.config.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user