配置文件整体重构

This commit is contained in:
tangly1024
2025-01-05 12:41:00 +08:00
parent 2831d2fb0c
commit 11eb466e96
30 changed files with 684 additions and 622 deletions

27
conf/dev.config.js Normal file
View File

@@ -0,0 +1,27 @@
/**
* 开发人员可能需要关注的配置
*/
module.exports = {
SUB_PATH: '', // leave this empty unless you want to deploy in a folder
DEBUG: process.env.NEXT_PUBLIC_DEBUG || false, // 是否显示调试按钮
// TAILWINDCSS 配置的自定义颜色,作废
BACKGROUND_LIGHT: '#eeeeee', // use hex value, don't forget '#' e.g #fffefc
BACKGROUND_DARK: '#000000', // use hex value, don't forget '#'
ENABLE_CACHE:
process.env.ENABLE_CACHE ||
process.env.npm_lifecycle_event === 'build' ||
process.env.npm_lifecycle_event === 'export', // 在打包过程中默认开启缓存,开发或运行时开启此功能意义不大。
isProd: process.env.VERCEL_ENV === 'production' || process.env.EXPORT, // distinguish between development and production environment (ref: https://vercel.com/docs/environment-variables#system-environment-variables)
BUNDLE_ANALYZER: process.env.ANALYZE === 'true' || false, // 是否展示编译依赖内容与大小
VERSION: (() => {
try {
// 优先使用环境变量否则从package.json中获取版本号
return (
process.env.NEXT_PUBLIC_VERSION || require('../package.json').version
)
} catch (error) {
console.warn('Failed to load package.json version:', error)
return '1.0.0' // 缺省版本号
}
})()
}