nuxt.config.ts 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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: ["@/assets/css/tailwind.css", "./src/assets/iconfont/iconfont.css"],
  73. postcss: {
  74. plugins: {
  75. tailwindcss: {},
  76. "postcss-px-to-viewport-8-plugin": {
  77. unitToConvert: "px",
  78. viewportWidth: 375,
  79. unitPrecision: 2,
  80. viewportUnit: "vw", // 指定需要转换成的视窗单位,默认vw
  81. fontViewportUnit: "vw", // 指定字体需要转换成的视窗单位,默认vw
  82. propList: ["*", "!border-radius"], // 能转化为vw的属性列表
  83. selectorBlackList: [], // 需要忽略的CSS选择器,不会转为视口单位,使用原有的px等单位。
  84. minPixelValue: 1, // 设置最小的转换数值,如果为1的话,只有大于1的值会被转换
  85. mediaQuery: false, // 媒体查询里的单位是否需要转换单位
  86. replace: true, // 是否直接更换属性值,而不添加备用属性
  87. exclude: [/node_modules/], // 忽略某些文件夹下的文件或特定文件,例如 'node_modules' 下的文件
  88. landscape: false, // 是否添加根据 landscapeWidth 生成的媒体查询条件 @media (orientation: landscape)
  89. landscapeUnit: "vw", // 横屏时使用的单位
  90. landscapeWidth: 1920, // 横屏时使用的视口宽度
  91. },
  92. },
  93. },
  94. });