lingrui-web/nuxt.config.ts
榆钱落尽槿花稀 2052b40fbc -引入CDN配置并优化图片资源加载
- 新增`useCdn` composable,用于全局CDN URL管理
- 在`nuxt.config.ts`中配置CDN域名
- 更新图片资源路径,使用CDN URL加载
- 优化页面样式,统一使用SCSS文件
- 删除冗余组件`CdnImageExample.vue`
-头部动效增加
-增加返回顶部按钮
2025-05-16 18:17:04 +08:00

77 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 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': {
target: "https://democs.0rui.cn/api",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
}
}
}
},
compatibilityDate: '2025-05-15'
})