export default defineNuxtConfig({
    //taget: "static",
    ssr: true,
    app: {
        head: {
            title: '',
            viewport: 'width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no',
            meta: [
                { name: 'description', content: '' },
                { name: 'keywords', content: '' },
                { name: 'viewport', content: 'width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no,viewport-fit=cover',tagPriority:10}
            ],
        },
    },
    compatibilityDate: '2025-10-13',
    devtools: { 
        enabled: true 
    },
    module: [
        '@nuxtjs/style-resources',
        '@element-plus/nuxt',
        "@gauseen/nuxt-proxy",
        '@pinia/nuxt',
    ],
    css: [
        '~/assets/css/global.css',
        '~/assets/css/font.css',
        'element-plus/dist/index.css',
        'element-plus/theme-chalk/display.css'
    ],
    build: {
        publicPath: '/',
        transpile: ['#app-manifest'],
    },
    nitro: {
        devServer: {
            port:10000, // 指定生产服务器的端口
        }
    },
    plugins: [
        '@/plugins/element-plus',
        {
            src: '@/plugins/request',
            mode: 'client'
        },
        { 
            src: '~/plugins/flexible.client.js', 
            mode: 'client' 
        }
    ],
    postcss: {//配置 postcss-pxtorem
        plugins: {
            'postcss-pxtorem': {
                rootValue: 75, // 关键配置：设计稿是750px就填75，是375px就填37.5
                propList: ['*'], // 需要转换的属性，*表示所有
                selectorBlackList: [], // 选择器黑名单
                // 只处理特定目录
                include: [
                    /pages/,
                    /components/,
                    /assets/,
                ],
                replace: true, // 替换包含rem的规则，不添加备用
                mediaQuery: false, // 媒体查询内的px是否转换
                minPixelValue: 2, // 最小转换值，小于2px不转换
                exclude: /node_modules/i // 排除 node_modules 中的文件
            }
        }
    },
    vite: {
        optimizeDeps: {
            include: ['#app-manifest'], // 强制包含该模块
        },
        server: {
            watch: {
                // 忽略某些文件的监听
                ignored: ['**/node_modules/nuxt/dist/app/composables/manifest.js']
            }
        }
    }
})
