12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- // https://nuxt.com/docs/api/configuration/nuxt-config
- export default defineNuxtConfig({
- srcDir: "src",
- modules: [
- "@vant/nuxt",
- "nuxt-swiper",
- "@vueuse/nuxt",
- "dayjs-nuxt",
- [
- "@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" }],
- },
- },
- css: ["@/assets/css/tailwind.css", "./src/assets/iconfont/iconfont.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, // 横屏时使用的视口宽度
- },
- },
- },
- });
|