This commit is contained in:
dzc committed 2026-10-29 22:54:57 +08:00
1 parent 5c8fa04585
commit 9283fa88d1
2 files changed
+4 -4

No files matched your search

+3 -3
View File
@@ -7,10 +7,10 @@
"scripts": {
"dev": "vite --force",
"dev:local": "vite --force --mode dev-local",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --mode prod",
"build:prod": "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --mode prod",
"build:dev": "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --mode dev",
"build:docker": "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --outDir ./docker/dist/",
"build:docker": "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --mode prod --outDir ./docker/dist/",
"lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src",
"prettier": "prettier --write ."
},
@@ -119,4 +119,4 @@
"type": "git",
"url": "https://gitee.com/log4j/pig"
}
}
}
+1 -1
View File
@@ -27,7 +27,7 @@ const viteConfig = defineConfig((mode: ConfigEnv) => {
if (fileEnv.VITE_FILE_ACCESS_APP_ID !== 'admin' || !/^[a-zA-Z0-9_-]{1,32}$/.test(fileEnv.VITE_FILE_ACCESS_KEY_ID || '')
|| !/^[A-Za-z0-9+/]+={0,2}$/.test(fileEnv.VITE_FILE_ACCESS_KEY || '')
|| Buffer.from(fileEnv.VITE_FILE_ACCESS_KEY || '', 'base64').length < 32) {
throw new Error('请配置文件访问 appId、kid 和至少 32 字节的 Base64 密钥(.env.<mode>.local)')
throw new Error('请配置文件访问 appId、kid 和至少 32 字节的 Base64 密钥;本地可用 .env.local,自动构建请通过 .env.prod 或流水线环境变量提供')
}
// 判断是否开发环境