nuxt.config.ts 2.4 KB

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