1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- // https://nuxt.com/docs/api/configuration/nuxt-config
- export default defineNuxtConfig({
- srcDir: "src",
- modules: [
- "@vant/nuxt",
- "nuxt-swiper",
- "@vueuse/nuxt",
- "dayjs-nuxt",
- "@samk-dev/nuxt-vcalendar",
- [
- "@pinia/nuxt",
- {
- autoImports: ["defineStore", "storeToRefs"],
- },
- ],
- ],
- dayjs: {
- plugins: [
- "isSameOrAfter",
- "isSameOrBefore",
- "isToday",
- "customParseFormat",
- "minMax",
- ],
- },
- runtimeConfig: {
- public: {
- baseApi: process.env.VITE_APP_BASE_URL,
- },
- },
- imports: {
- dirs: ["stores", "api"],
- },
- compatibilityDate: "2024-04-03",
- devtools: { enabled: false },
- app: {
- head: {
- title: "逍遥游",
- meta: [
- {
- name: "charset",
- content: "utf-8",
- },
- {
- name: "viewport",
- content:
- "width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover",
- },
- {
- name: "renderer",
- content: "webkit",
- },
- ],
- link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.svg" }],
- // script: [
- // {
- // src: "https://cdn.jsdelivr.net/npm/eruda",
- // type: "text/javascript",
- // },
- // {
- // innerHTML: "eruda.init();",
- // },
- // {
- // src: "//unpkg.com/vconsole@latest/dist/vconsole.min.js",
- // type: "text/javascript",
- // },
- // { innerHTML: "new VConsole()" },
- // ],
- },
- },
- css: [
- "@/assets/css/tailwind.css",
- "./src/assets/iconfont/iconfont.css",
- "@/assets/css/font.css",
- ],
- postcss: {
- plugins: {
- tailwindcss: {},
- "postcss-px-to-viewport-8-plugin": {
- unitToConvert: "px",
- viewportWidth: 375,
- unitPrecision: 2,
- viewportUnit: "vw", // 指定需要转换成的视窗单位,默认vw
- fontViewportUnit: "vw", // 指定字体需要转换成的视窗单位,默认vw
- propList: ["*", "!border-radius"], // 能转化为vw的属性列表
- selectorBlackList: [], // 需要忽略的CSS选择器,不会转为视口单位,使用原有的px等单位。
- minPixelValue: 1, // 设置最小的转换数值,如果为1的话,只有大于1的值会被转换
- mediaQuery: false, // 媒体查询里的单位是否需要转换单位
- replace: true, // 是否直接更换属性值,而不添加备用属性
- exclude: [/node_modules/], // 忽略某些文件夹下的文件或特定文件,例如 'node_modules' 下的文件
- landscape: false, // 是否添加根据 landscapeWidth 生成的媒体查询条件 @media (orientation: landscape)
- landscapeUnit: "vw", // 横屏时使用的单位
- landscapeWidth: 1920, // 横屏时使用的视口宽度
- },
- },
- },
- });
|