当前位置:网站首页>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

边栏推荐
- Which water in the environment needs water quality monitoring
- Impact relay jc-7/11/dc110v
- InputStream/OutputStream(文件的输入输出)
- STM32 单片机ADC 电压计算
- The width of the picture in rich text used by wechat applet exceeds the problem
- Cloud native - SSH article that must be read on the cloud (commonly used for remote login to ECS)
- Design and implementation of redis 7.0 multi part AOF
- HMS v1.0 appointment. PHP editid parameter SQL injection vulnerability (cve-2022-25491)
- R statistical mapping - random forest classification analysis and species abundance difference test combination diagram
- Common JS tool Libraries
猜你喜欢

C语言练习题(递归)

云原生——上云必读之SSH篇(常用于远程登录云服务器)

Notes and notes

Learning multi-level structural information for small organ segmentation

JS how to convert seconds into hours, minutes and seconds display

分布式CAP理论

Native Cloud - SSH articles must be read on Cloud (used for Remote Login to Cloud Server)

Distributed cap theory

Review | categories and mechanisms of action of covid-19 neutralizing antibodies and small molecule drugs

复合非线性反馈控制(二)
随机推荐
Distributed cap theory
How to help others effectively
[microservice] Nacos cluster building and loading file configuration
The width of the picture in rich text used by wechat applet exceeds the problem
【无标题】
How to realize multi account login of video platform members
How to implement cross domain requests
Weekly summary (*63): about positive energy
Grounding relay dd-1/60
Arcpy uses the updatelayer function to change the symbol system of the layer
分布式CAP理论
Overview of convolutional neural network structure optimization
如何实现视频平台会员多账号登录
C實現貪吃蛇小遊戲
实用的小工具指令
Practical gadget instructions
ES6 模块化
手动对list进行分页(参数list ,当前页,页面大小)
Invalid revision: 3.18.1-g262b901-dirty
云原生——上云必读之SSH篇(常用于远程登录云服务器)