当前位置:网站首页>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
边栏推荐
- MySQL的information_schema数据库
- 云原生——上云必读之SSH篇(常用于远程登录云服务器)
- 740. Delete and get points
- [microservice] Nacos cluster building and loading file configuration
- How to determine whether an array contains an element
- webrtc 快速搭建 视频通话 视频会议
- My NVIDIA developer journey - optimizing graphics card performance
- Uninstall Google drive hard drive - you must exit the program to uninstall
- JS flattened array of number shape structure
- 如何避免 JVM 内存泄漏?
猜你喜欢
InputStream/OutputStream(文件的输入输出)
Tree DP
Arcpy 利用updatelayer函数改变图层的符号系统
JS flattened array of number shape structure
Learning multi-level structural information for small organ segmentation
C language - Blue Bridge Cup - Snake filling
Learn about the Internet of things protocol WiFi ZigBee Bluetooth, etc. --- WiFi and WiFi protocols start from WiFi. What do we need to know about WiFi protocol itself?
Arcpy uses the updatelayer function to change the symbol system of the layer
树形dp
SQL join, left join, right join usage
随机推荐
注释与注解
Abap:ooalv realizes the function of adding, deleting, modifying and checking
How to use multithreading to export excel under massive data? Source code attached!
Fast power (template)
Learn about the Internet of things protocol WiFi ZigBee Bluetooth, etc. --- WiFi and WiFi protocols start from WiFi. What do we need to know about WiFi protocol itself?
测试岗的中年危机该如何选择?是坚守还是另寻出路?且看下文
How to determine whether an array contains an element
2022.7.3-----leetcode.556
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
AWT常用组件、FileDialog文件选择框
Win10 clear quick access - leave no trace
JS arguments parameter usage and explanation
STM32 单片机ADC 电压计算
How to get the parent node of all nodes in El tree
lightroom 导入图片灰色/黑色矩形 多显示器
APScheduler如何设置任务不并发(即第一个任务执行完再执行下一个)?
Notes and notes
Detailed explanation of common APIs for component and container containers: frame, panel, scrollpane
Compound nonlinear feedback control (2)