| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- // https://nuxt.com/docs/api/configuration/nuxt-config
- export default defineNuxtConfig({
- modules: ['@vueuse/nuxt', '@pinia/nuxt', '@nuxt/icon', '@nuxt/image', '@vant/nuxt'],
- compatibilityDate: '2025-07-15',
- // devtools: { enabled: true },
- css: ['~/assets/scss/main.scss'], // 全局样式文件
- plugins: ['~/plugins/index.js'],
- app: {
- head: {
- meta: [{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' }]
- }
- },
- postcss: {
- plugins: {
- autoprefixer: {
- overrideBrowserslist: ['last 15 versions']
- },
- 'postcss-pxtorem': {
- rootValue: 37.5,
- unitPrecision: 4,
- propList: ['*'],
- selectorBlackList: [
- 'html',
- 'body',
- // 排除所有不以 mb- 开头的类选择器
- /^\.(?!mb-)/
- ],
- replace: true,
- mediaQuery: false,
- minRemValue: 0
- }
- }
- },
- icon: {
- localApiEndpoint: '/nuxt-icon'
- },
- image: {
- // format: ['avif', 'webp', 'png']
- format: ['webp', 'png']
- },
- nitro: {
- devProxy: {
- '/api': {
- target: 'http://localhost:8080', // 你的后端地址
- changeOrigin: true,
- prependPath: true
- }
- }
- },
- routeRules: {
- '/web/**': { appLayout: 'web' },
- '/mobile/**': { appLayout: 'mobile' }
- }
- // vite: {
- // css: {
- // preprocessorOptions: {
- // scss: {
- // additionalData: '@use "~/assets/_colors.scss" as *;'
- // }
- // }
- // }
- // }
- })
|