当前位置:网站首页>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 choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
- STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
- 4G wireless all network solar hydrological equipment power monitoring system bms110
- [openvino+paddle] paddle detection / OCR / SEG export based on paddle2onnx
- Arcpy uses the updatelayer function to change the symbol system of the layer
- How to realize multi account login of video platform members
- 运算符<< >>傻瓜式测试用例
- Functions in C language (detailed explanation)
- The end of the Internet is rural revitalization
- SQL join, left join, right join usage
猜你喜欢

How to solve the component conflicts caused by scrollbars in GridView

QT get random color value and set label background color code

雲原生——上雲必讀之SSH篇(常用於遠程登錄雲服務器)
![[untitled]](/img/32/cfd45bb5e8555ea2ad344161370dbe.png)
[untitled]

C语言练习题(递归)

My NVIDIA developer journey - optimizing graphics card performance

How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
![Yiwen unlocks Huawei's new cloud skills - the whole process of aiot development [device access - ESP end-to-side data collection [mqtt]- real time data analysis] (step-by-step screenshot is more detai](/img/a5/be967170a18cb2de097f01a6d4e039.jpg)
Yiwen unlocks Huawei's new cloud skills - the whole process of aiot development [device access - ESP end-to-side data collection [mqtt]- real time data analysis] (step-by-step screenshot is more detai

Arcpy 利用updatelayer函数改变图层的符号系统

如何避免 JVM 内存泄漏?
随机推荐
Invalid bound statement (not found): com. example. mapper. TblUserRecordMapper. login
JS execution mechanism
ORICO ORICO outdoor power experience, lightweight and portable, the most convenient office charging station
2022.7.2-----leetcode. eight hundred and seventy-one
Reading notes of Clickhouse principle analysis and Application Practice (4)
Leakage detection relay jy82-2p
Invalid revision: 3.18.1-g262b901-dirty
C实现贪吃蛇小游戏
FRP intranet penetration, reverse proxy
Arcpy uses the updatelayer function to change the symbol system of the layer
Average two numbers
报错cvc-complex-type.2.4.a: 发现了以元素 ‘base-extension‘ 开头的无效内容。应以 ‘{layoutlib}‘ 之一开头。
Gridview出现滚动条,组件冲突,如何解决
Internet of things protocol ZigBee ZigBee module uses the concept of protocol stack
LayoutManager布局管理器:FlowLayout、BorderLayout、GridLayout、GridBagLayout、CardLayout、BoxLayout
2022.7.3-----leetcode.556
How to help others effectively
Manually page the list (parameter list, current page, page size)
JSON Web Token----JWT和傳統session登錄認證對比
How to determine whether an array contains an element