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

边栏推荐
- Notes and notes
- Nexus 6p downgraded from 8.0 to 6.0+root
- 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
- Nexus 6p从8.0降级6.0+root
- QT qtablewidget table column top requirements ideas and codes
- buuctf-pwn write-ups (8)
- 双色球案例
- Experience weekly report no. 102 (July 4, 2022)
- C realize Snake games
- Gridview出现滚动条,组件冲突,如何解决
猜你喜欢

JSON Web Token----JWT和傳統session登錄認證對比

体验碎周报第 102 期(2022.7.4)

测试岗的中年危机该如何选择?是坚守还是另寻出路?且看下文

Inputstream/outputstream (input and output of file)

Leetcode question brushing record | 206_ Reverse linked list

Appium foundation - appium installation (II)

MySQL installation and configuration

SQL join, left join, right join usage

JSON Web Token----JWT和传统session登录认证对比

Impact relay jc-7/11/dc110v
随机推荐
Distributed cap theory
Tsinghua University product: penalty gradient norm improves generalization of deep learning model
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?
JS get the attribute values nested in the object
509. Fibonacci number, all paths of climbing stairs, minimum cost of climbing stairs
报错cvc-complex-type.2.4.a: 发现了以元素 ‘base-extension‘ 开头的无效内容。应以 ‘{layoutlib}‘ 之一开头。
Component、Container容器常用API详解:Frame、Panel、ScrollPane
Sword finger offer II 038 Daily temperature
C实现贪吃蛇小游戏
C语言中的排序,实现从小到大的数字排序法
How to implement lazy loading in El select (with search function)
C realize Snake games
STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
My NVIDIA developer journey - optimizing graphics card performance
198. House raiding
QT get random color value and set label background color code
【微服务】Nacos集群搭建以及加载文件配置
如何实现视频平台会员多账号登录
Overview of convolutional neural network structure optimization
MySQL的information_schema数据库