build:优化环境变量设置和 VConsole 配置
- 使用 cross-env 替代直接设置 NODE_ENV,提高跨平台兼容性- 移除 vconsole.js服务端代码,避免 SSG/SSR 问题 - 优化 vconsole.client.ts,确保仅在客户端启用 VConsole
This commit is contained in:
parent
ddbe15cfb1
commit
77e08232f7
@ -1,7 +0,0 @@
|
||||
import VConsole from 'vconsole'
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
if (process.client) { // 仅在客户端运行
|
||||
const vConsole = new VConsole()
|
||||
}
|
||||
})
|
@ -6,7 +6,7 @@
|
||||
"scripts": {
|
||||
"build": "nuxt build",
|
||||
"dev": "cross-env ENV_FILE=.env.test nuxt dev",
|
||||
"dev:prod": "NODE_ENV=production ENV_FILE=.env.prod nuxt dev",
|
||||
"dev:prod": "cross-env ENV_FILE=.env.prod nuxt dev",
|
||||
"build:test": "cross-env ENV_FILE=.env.test nuxt build",
|
||||
"build:prod": "cross-env ENV_FILE=.env.prod nuxt build",
|
||||
"generate": "nuxt generate",
|
||||
|
Loading…
Reference in New Issue
Block a user