| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- // https://nuxt.com/docs/api/configuration/nuxt-config
- export default defineNuxtConfig({
- modules: ['@vueuse/nuxt', '@pinia/nuxt', '@nuxt/icon', '@nuxt/image'],
- 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: {
- 'postcss-pxtorem': {
- rootValue: 37.5,
- unitPrecision: 4,
- propList: ['*'],
- selectorBlackList: [],
- replace: true,
- mediaQuery: false,
- minRemValue: 0,
- exclude: e => {
- if (e.includes('/app/pages/mobile/') || e.includes('/app/components/mobile/') || e.includes('/app/layouts/mobile.vue')) {
- return false
- } else {
- return true
- }
- }
- }
- }
- },
- 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 *;'
- // }
- // }
- // }
- // }
- })
|