nuxt.config.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // https://nuxt.com/docs/api/configuration/nuxt-config
  2. export default defineNuxtConfig({
  3. srcDir: "src",
  4. modules: [
  5. "@vant/nuxt",
  6. "nuxt-swiper",
  7. "@vueuse/nuxt",
  8. "dayjs-nuxt",
  9. "@samk-dev/nuxt-vcalendar",
  10. [
  11. "@pinia/nuxt",
  12. {
  13. autoImports: ["defineStore", "storeToRefs"],
  14. },
  15. ],
  16. ],
  17. dayjs: {
  18. plugins: [
  19. "isSameOrAfter",
  20. "isSameOrBefore",
  21. "isToday",
  22. "customParseFormat",
  23. "minMax",
  24. ],
  25. },
  26. runtimeConfig: {
  27. public: {
  28. baseApi: process.env.VITE_APP_BASE_URL,
  29. baseIM:process.env.VITE_APP_IM_URL
  30. },
  31. },
  32. imports: {
  33. dirs: ["stores", "api"],
  34. },
  35. compatibilityDate: "2024-04-03",
  36. devtools: { enabled: false },
  37. app: {
  38. head: {
  39. title: "逍遥游",
  40. meta: [
  41. {
  42. name: "charset",
  43. content: "utf-8",
  44. },
  45. {
  46. name: "viewport",
  47. content:
  48. "width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover",
  49. },
  50. {
  51. name: "renderer",
  52. content: "webkit",
  53. },
  54. ],
  55. link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.svg" }],
  56. // script: [
  57. // {
  58. // src: "https://cdn.jsdelivr.net/npm/eruda",
  59. // type: "text/javascript",
  60. // },
  61. // {
  62. // innerHTML: "eruda.init();",
  63. // },
  64. // {
  65. // src: "//unpkg.com/vconsole@latest/dist/vconsole.min.js",
  66. // type: "text/javascript",
  67. // },
  68. // { innerHTML: "new VConsole()" },
  69. // ],
  70. },
  71. },
  72. css: [
  73. "@/assets/css/tailwind.css",
  74. "./src/assets/iconfont/iconfont.css",
  75. "@/assets/css/font.css",
  76. ],
  77. postcss: {
  78. plugins: {
  79. tailwindcss: {},
  80. "postcss-px-to-viewport-8-plugin": {
  81. unitToConvert: "px",
  82. viewportWidth: 375,
  83. unitPrecision: 2,
  84. viewportUnit: "vw", // 指定需要转换成的视窗单位,默认vw
  85. fontViewportUnit: "vw", // 指定字体需要转换成的视窗单位,默认vw
  86. propList: ["*", "!border-radius"], // 能转化为vw的属性列表
  87. selectorBlackList: [], // 需要忽略的CSS选择器,不会转为视口单位,使用原有的px等单位。
  88. minPixelValue: 1, // 设置最小的转换数值,如果为1的话,只有大于1的值会被转换
  89. mediaQuery: false, // 媒体查询里的单位是否需要转换单位
  90. replace: true, // 是否直接更换属性值,而不添加备用属性
  91. exclude: [/node_modules/], // 忽略某些文件夹下的文件或特定文件,例如 'node_modules' 下的文件
  92. landscape: false, // 是否添加根据 landscapeWidth 生成的媒体查询条件 @media (orientation: landscape)
  93. landscapeUnit: "vw", // 横屏时使用的单位
  94. landscapeWidth: 1920, // 横屏时使用的视口宽度
  95. },
  96. },
  97. },
  98. });