当前位置:网站首页>Uniapp custom environment variables
Uniapp custom environment variables
2022-07-04 06:23:00 【@Time Traveler】
1、 Create in the root directory package.json file , Write the following , Refer to the official website for specific configuration items package.json
{
"uni-app": {
"scripts": {
"dev": {
// Configuration item name
"title":"h5 Test environment ", // Name on the menu toolbar
"env": {
"UNI_PLATFORM": "h5" // platform
},
"define": {
"H5-DEV": true // Variable name
}
},
"prod": {
"title":"h5 Production environment ",
"env": {
"UNI_PLATFORM": "h5"
},
"define": {
"H5-PROD": true
}
}
}
}
}
2、 Using environment variables
// #ifdef H5-DEV
console.log('dev')
// #endif
// #ifdef H5-PROD
console.log('prod')
// #endif
3、 Compile the package
边栏推荐
- 复合非线性反馈控制(二)
- How to avoid JVM memory leakage?
- 【无标题】
- 198. House raiding
- R statistical mapping - random forest classification analysis and species abundance difference test combination diagram
- 17-18. Dependency scope and life cycle plug-ins
- JS flattened array of number shape structure
- 如何避免 JVM 内存泄漏?
- How to get the parent node of all nodes in El tree
- High performance parallel programming and optimization | lesson 02 homework at home
猜你喜欢
After the festival, a large number of people change careers. Is it still time to be 30? Listen to the experience of the past people
Review | categories and mechanisms of action of covid-19 neutralizing antibodies and small molecule drugs
17-18. Dependency scope and life cycle plug-ins
AWT常用组件、FileDialog文件选择框
Gridview出现滚动条,组件冲突,如何解决
JSON web token -- comparison between JWT and traditional session login authentication
Arcpy uses the updatelayer function to change the symbol system of the layer
Sleep quality today 78 points
70000 words of detailed explanation of the whole process of pad openvino [CPU] - from environment configuration to model deployment
198. House raiding
随机推荐
[Chongqing Guangdong education] electronic circuit homework question bank of RTVU secondary school
How to get the parent node of all nodes in El tree
Native Cloud - SSH articles must be read on Cloud (used for Remote Login to Cloud Server)
STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
Appium foundation - appium installation (II)
px em rem的区别
webrtc 快速搭建 视频通话 视频会议
Grounding relay dd-1/60
ES6 modularization
Dimension and format of data
MySQL的information_schema数据库
How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
剑指 Offer II 038. 每日温度
对List进行排序工具类,可以对字符串排序
如何避免 JVM 内存泄漏?
体验碎周报第 102 期(2022.7.4)
运算符<< >>傻瓜式测试用例
17-18. Dependency scope and life cycle plug-ins
JS flattened array of number shape structure
Invalid revision: 3.18.1-g262b901-dirty