tuanshiwei-web/nuxt.config.ts

87 lines
1.7 KiB
TypeScript
Raw Permalink Normal View History

2025-05-24 09:12:30 +08:00
// https://nuxt.com/docs/api/configuration/nuxt-config
import { defineNuxtConfig } from 'nuxt/config'
export default defineNuxtConfig({
runtimeConfig: {
public: {
cdnDomain: 'https://cdn.web.0rui.cn'
}
},
app: {
baseURL:'/web/',
},
nitro: {
routeRules: {
'/**': { trailingSlash: false }
}
},
router: {
// extendRoutes(routes, resolve) {
// routes.push({
// name: 'index_info',
// path: '/params/:param1', // * 表示可选的多个参数
// component: resolve(__dirname, 'pages/index_info.vue')
// });
// }
},
// 设置为false以启用客户端渲染适合静态生成
ssr: false,
// 静态生成配置
generate: {
routes: [
'/',
'/aboutUs',
'/proServices',
'/proServices_con',
'/societyDuty',
'/societyDutyNew',
'/concatUs',
'/customerReviews'
]
},
css: [
'swiper/css',
'swiper/css/mousewheel',
'@/assets/css/common.scss'
],
devtools: { enabled: true },
postcss: {
plugins: {
autoprefixer: {},
tailwindcss: {},
},
},
modules: ['@pinia/nuxt', 'nuxt-icons'],
vite: {
server: {
proxy: {
'/api': {
2025-05-29 14:42:01 +08:00
target: "https://tsw.hschool.com.cn/api",
2025-05-24 09:12:30 +08:00
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
'http://192.168.10.221/api': {
target: "http://tsw.hschool.com.cn/api",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
2025-05-24 09:12:30 +08:00
}
}
}
},
devServer: {
host: '0.0.0.0', // 允许任何IP地址访问
port: 3000 // 设置端口号
},
2025-05-29 14:42:01 +08:00
compatibilityDate: '2025-05-29'
2025-05-24 09:12:30 +08:00
})