nuxt.config.ts 1.8 KB

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