1***@qq.com
1***@qq.com
  • 发布:2024-07-05 11:38
  • 更新:2024-07-05 11:38
  • 阅读:80

hbuilder4.15版本,vue-cli版本5.0.8,自定义条件编译失效

分类:HBuilderX

"uni-app": {
"scripts": {
"h5-dev": {
"title": "发行H5 - 开发版",
"browser": "chrome",
"env": {
"UNI_PLATFORM": "h5",
"MY_TEST": "develeopment"
},
"define": {
"H5-MP-DEV": true
}
},
"h5-prod": {
"title": "发行H5 - 生产版",
"browser": "chrome",
"env": {
"UNI_PLATFORM": "h5",
"MY_TEST": "production"
},
"define": {
"H5-MP-PROD": true
}
},
}
}
let env = "development";
//#ifdef H5-MP-DEV
env = "development";
//#endif

//#ifdef H5-MP-PROD
env = "production";
//#endif

console.log(env, "env");
vue3+vite 我使用自定义编译指令npm run dev:custom h5-dev,还有编辑器上的发行-自定义发行-发行h5-开发版。为什么编译出来env一直是production

2024-07-05 11:38 负责人:无 分享
已邀请:

要回复问题请先登录注册