nuxt.config.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // https://nuxt.com/docs/api/configuration/nuxt-config
  2. export default defineNuxtConfig({
  3. compatibilityDate: '2025-05-15',
  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. ]
  14. }
  15. },
  16. devtools: { enabled: true },
  17. srcDir: 'src/',
  18. modules: ['@pinia/nuxt', '@ant-design-vue/nuxt'],
  19. components: [
  20. {
  21. path: '~/components',
  22. pathPrefix: false,
  23. extensions: ['.vue'],
  24. }
  25. ],
  26. build: {
  27. transpile: [
  28. '@imengyu/vue-scroll-rect',
  29. '@imengyu/imengyu-utils',
  30. ],
  31. },
  32. vite: {
  33. build: {
  34. minify: 'terser',
  35. terserOptions: {
  36. compress: {
  37. drop_console: true,
  38. drop_debugger: true,
  39. },
  40. },
  41. },
  42. },
  43. routeRules: {
  44. //'/**': { swr: false, isr: false, headers: { 'cache-control': 'no-store, max-age=0' } },
  45. /**/
  46. '/': { swr: 1800 },
  47. '/about/': { swr: 1800 },
  48. '/communicate/': { swr: 1800 },
  49. '/fusion/': { swr: 1800 },
  50. '/inheritor/': { swr: 1800 },
  51. '/introduction/': { swr: 1800 },
  52. '/news/': { swr: 1800 },
  53. '/research/': { swr: 1800 },
  54. '/introduction/**': { swr: false },
  55. '/communicate/**': { swr: false },
  56. '/fusion/**': { swr: false },
  57. '/inheritor/**': { swr: false },
  58. '/news/**': { swr: false },
  59. '/research/**': { swr: false },
  60. '/village/**': { swr: false },
  61. '/inheritor/submit': { ssr: false },
  62. }
  63. })