nuxt.config.ts 2.8 KB

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