chore: track root project files and subrepos

This commit is contained in:
hajimi
2026-05-23 13:22:03 +08:00
parent 1624f023a2
commit 648ed678f3
1035 changed files with 154418 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
import dotenv from 'dotenv'
dotenv.config({ path: `.env.${process.env.NODE_ENV}` })
const ENV_PREFIX = 'NUXT_'
export const getEnvConfig = () => {
const config: Record<string, any> = {}
Object.keys(process.env).forEach((evnKey) => {
if (evnKey.includes(ENV_PREFIX)) {
const key = evnKey
.replace(ENV_PREFIX, '')
.toLowerCase()
.replace(/\_([A-Za-z])/g, function (all, $1) {
return $1.toUpperCase()
})
config[key] = process.env[evnKey]
}
})
return config
}