"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
0 个回复