nuxt.config.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. css: ['bootstrap/dist/css/bootstrap.min.css'],
  18. devtools: { enabled: true },
  19. srcDir: 'src/',
  20. modules: ['@pinia/nuxt', '@ant-design-vue/nuxt', '@nuxt/icon'],
  21. components: [
  22. {
  23. path: '~/components',
  24. pathPrefix: false,
  25. extensions: ['.vue'],
  26. }
  27. ],
  28. icon: {
  29. provider: 'iconify',
  30. serverBundle: false,
  31. },
  32. build: {
  33. transpile: [
  34. '@imengyu/vue-scroll-rect',
  35. '@imengyu/imengyu-utils',
  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. '/channel/**': { swr: 1800 },
  55. '/page/submit': {swr: 1800 },
  56. '/search/**': { swr: false },*/
  57. }
  58. })