nuxt.config.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import { defineNuxtConfig } from "nuxt/config";
  2. // https://nuxt.com/docs/api/configuration/nuxt-config
  3. export default defineNuxtConfig({
  4. compatibilityDate: '2025-05-15',
  5. app: {
  6. head: {
  7. title: '闽南文化(漳州)生态保护区',
  8. viewport: 'width=device-width, initial-scale=1, maximum-scale=1',
  9. htmlAttrs: {
  10. lang: 'zh',
  11. },
  12. link: [
  13. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  14. ]
  15. }
  16. },
  17. devtools: { enabled: false },
  18. srcDir: 'src/',
  19. ignore: [
  20. 'src/pages/**/components/**',
  21. ],
  22. modules: ['@pinia/nuxt', '@ant-design-vue/nuxt', '@nuxt/icon', '@nuxtjs/tailwindcss'],
  23. components: [
  24. {
  25. path: '~/components',
  26. pathPrefix: false,
  27. extensions: ['.vue'],
  28. }
  29. ],
  30. icon: {
  31. provider: 'iconify',
  32. serverBundle: false,
  33. },
  34. tailwindcss: {
  35. cssPath: '~/assets/css/tailwind.css',
  36. },
  37. build: {
  38. transpile: [
  39. '@imengyu/vue-scroll-rect',
  40. '@imengyu/imengyu-utils',
  41. '@imengyu/js-request-transform',
  42. ],
  43. },
  44. vite: {
  45. build: {
  46. minify: 'terser',
  47. terserOptions: {
  48. compress: {
  49. drop_console: true,
  50. drop_debugger: true,
  51. },
  52. },
  53. },
  54. },
  55. routeRules: {
  56. '/**': { swr: false, isr: false, headers: { 'cache-control': 'no-store, max-age=0' } },
  57. /* '/uploads/**': {
  58. proxy: 'https://xmswhycbhzx.cn/uploads/**'
  59. }, */
  60. /*
  61. '/': { swr: 1800 },
  62. '/about/': { swr: 1800 },
  63. '/channel/**': { swr: 1800 },
  64. '/page/submit': {swr: 1800 },
  65. '/search/**': { swr: false },*/
  66. }
  67. })