nuxt.config.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. '@imengyu/js-request-transform',
  36. ],
  37. },
  38. vite: {
  39. build: {
  40. minify: 'terser',
  41. terserOptions: {
  42. compress: {
  43. drop_console: true,
  44. drop_debugger: true,
  45. },
  46. },
  47. },
  48. },
  49. routeRules: {
  50. '/**': { swr: false, isr: false, headers: { 'cache-control': 'no-store, max-age=0' } },
  51. /*
  52. '/': { swr: 1800 },
  53. '/about/': { swr: 1800 },
  54. '/communicate/': { swr: 1800 },
  55. '/fusion/': { swr: 1800 },
  56. '/inheritor/': { swr: 1800 },
  57. '/introduction/': { swr: 1800 },
  58. '/news/': { swr: 1800 },
  59. '/research/': { swr: 1800 },*/
  60. '/introduction/**': { swr: false },
  61. '/communicate/**': { swr: false },
  62. '/fusion/**': { swr: false },
  63. '/inheritor/**': { swr: false },
  64. '/news/**': { swr: false },
  65. '/research/**': { swr: false },
  66. '/village/**': { swr: false },
  67. '/inheritor/submit': { ssr: false },
  68. }
  69. })