Files
HuLa-Website/nuxt.config.ts
Dawn 8f3c444c83 fix(common): 🐛 修复首页的安装包路径问题
优化一些图标和统计数据的逻辑
2025-11-12 14:01:27 +08:00

55 lines
1.4 KiB
TypeScript
Raw Permalink 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
export default defineNuxtConfig({
modules: ['@nuxt/test-utils/module', '@nuxt/ui', '@nuxt/image', '@nuxtjs/color-mode'],
icon: {
serverBundle: {
collections: ['solar']
},
fetchTimeout: 2000,
fallbackToApi: true // 允许回退到 CDN但优先使用本地图标库
},
app: {
pageTransition: { name: 'page', mode: 'out-in' },
layoutTransition: { name: 'layout', mode: 'out-in' },
head: {
script: [{ src: '/icon.js' }]
}
},
colorMode: {
preference: 'dark' // default value of colorMode.preference
},
components: [
{
path: '~/components/',
pathPrefix: false
}
],
vite: {
css: {
preprocessorOptions: {
scss: {
api: 'modern',
additionalData: '@use "~/styles/scss/variable.scss" as *;'
}
}
},
esbuild: {
// * 打包去除 console.log && debugger
pure: ['console.log', 'debugger']
}
},
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
devServer: {
port: 3000
},
runtimeConfig: {
// 服务器端私有变量(不会暴露给客户端)
githubToken: process.env.TOTAL_COUNT_TOKEN,
// 公共变量(会暴露给客户端,如果需要的话)
public: {
// 可以在这里添加需要在客户端使用的公共配置
}
}
})