当前位置:网站首页>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
边栏推荐
- A little understanding of GSLB (global server load balance) technology
- Average two numbers
- 运算符<< >>傻瓜式测试用例
- Detectron: train your own data set -- convert your own data format to coco format
- MySQL的information_schema数据库
- JS get the attribute values nested in the object
- [untitled]
- Internet of things protocol ZigBee ZigBee module uses the concept of protocol stack
- How to get the parent node of all nodes in El tree
- Webrtc quickly set up video call and video conference
猜你喜欢
740. Delete and get points
Reading notes of Clickhouse principle analysis and Application Practice (4)
AWT常用组件、FileDialog文件选择框
报错cvc-complex-type.2.4.a: 发现了以元素 ‘base-extension‘ 开头的无效内容。应以 ‘{layoutlib}‘ 之一开头。
Review | categories and mechanisms of action of covid-19 neutralizing antibodies and small molecule drugs
《ClickHouse原理解析与应用实践》读书笔记(4)
QT qtablewidget table column top requirements ideas and codes
剑指 Offer II 038. 每日温度
Tree DP
Learning multi-level structural information for small organ segmentation
随机推荐
Overview of convolutional neural network structure optimization
The width of the picture in rich text used by wechat applet exceeds the problem
js arguments参数使用和详解
Detectron:训练自己的数据集——将自己的数据格式转换成COCO格式
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
How to implement lazy loading in El select (with search function)
Notes and notes
Reading notes of Clickhouse principle analysis and Application Practice (4)
Manually page the list (parameter list, current page, page size)
手动对list进行分页(参数list ,当前页,页面大小)
JS flattened array of number shape structure
C language - Blue Bridge Cup - Snake filling
C réaliser des jeux de serpents gourmands
微信小程序使用rich-text中图片宽度超出问题
C實現貪吃蛇小遊戲
对List进行排序工具类,可以对字符串排序
Average two numbers
C realize Snake games
Tsinghua University product: penalty gradient norm improves generalization of deep learning model
The end of the Internet is rural revitalization