nuxt.config.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // https://nuxt.com/docs/api/configuration/nuxt-config
  2. export default defineNuxtConfig({
  3. compatibilityDate: '2026-03-06',
  4. app: {
  5. head: {
  6. title: '闽南文化生态保护区(厦门市)',
  7. viewport: 'width=device-width, initial-scale=1, maximum-scale=1',
  8. htmlAttrs: {
  9. lang: 'zh',
  10. },
  11. link: [
  12. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  13. { rel: 'icon', type: 'image/png', sizes: '32x32', href: '/favicon-32x32.png' },
  14. { rel: 'icon', type: 'image/png', sizes: '16x16', href: '/favicon-16x16.png' },
  15. { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' }
  16. ]
  17. }
  18. },
  19. devtools: { enabled: true },
  20. modules: [
  21. '@pinia/nuxt',
  22. '@ant-design-vue/nuxt',
  23. ],
  24. components: [
  25. {
  26. path: '~/components',
  27. pathPrefix: false,
  28. extensions: ['.vue'],
  29. }
  30. ],
  31. build: {
  32. transpile: [
  33. '@imengyu/vue-scroll-rect',
  34. '@imengyu/imengyu-utils',
  35. ],
  36. },
  37. vite: {
  38. build: {
  39. minify: 'terser',
  40. terserOptions: {
  41. compress: {
  42. drop_console: true,
  43. drop_debugger: true,
  44. },
  45. },
  46. },
  47. },
  48. routeRules: {
  49. '/**': { swr: false, isr: false, headers: { 'cache-control': 'no-store, max-age=0' } },
  50. /*
  51. '/': { swr: 1800 },
  52. '/about/': { swr: 1800 },
  53. '/communicate/': { swr: 1800 },
  54. '/fusion/': { swr: 1800 },
  55. '/inheritor/': { swr: 1800 },
  56. '/introduction/': { swr: 1800 },
  57. '/news/': { swr: 1800 },
  58. '/research/': { swr: 1800 },*/
  59. '/introduction/**': { swr: false },
  60. '/communicate/**': { swr: false },
  61. '/fusion/**': { swr: false },
  62. '/inheritor/**': { swr: false },
  63. '/news/**': { swr: false },
  64. '/research/**': { swr: false },
  65. '/village/**': { swr: false },
  66. '/inheritor/submit': { ssr: false },
  67. }
  68. })