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

边栏推荐
- QT get random color value and set label background color code
- 体验碎周报第 102 期(2022.7.4)
- The end of the Internet is rural revitalization
- FRP intranet penetration, reverse proxy
- How does apscheduler set tasks not to be concurrent (that is, execute the next task after the first one)?
- How to implement cross domain requests
- JSON Web Token----JWT和傳統session登錄認證對比
- APScheduler如何设置任务不并发(即第一个任务执行完再执行下一个)?
- Reading notes of Clickhouse principle analysis and Application Practice (4)
- 70000 words of detailed explanation of the whole process of pad openvino [CPU] - from environment configuration to model deployment
猜你喜欢

ES6 modularization

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

《ClickHouse原理解析与应用实践》读书笔记(4)

Gridview出现滚动条,组件冲突,如何解决

LayoutManager布局管理器:FlowLayout、BorderLayout、GridLayout、GridBagLayout、CardLayout、BoxLayout

Component、Container容器常用API详解:Frame、Panel、ScrollPane

Impact relay jc-7/11/dc110v

Grounding relay dd-1/60

High performance parallel programming and optimization | lesson 02 homework at home

如何获取el-tree中所有节点的父节点
随机推荐
746. Climb stairs with minimum cost
Component、Container容器常用API详解:Frame、Panel、ScrollPane
MySQL的information_schema数据库
Internet of things protocol ZigBee ZigBee module uses the concept of protocol stack
复合非线性反馈控制(二)
微信小程序使用rich-text中图片宽度超出问题
Overview of convolutional neural network structure optimization
2022.7.2-----leetcode.871
STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
Arcpy 利用updatelayer函数改变图层的符号系统
A little understanding of GSLB (global server load balance) technology
Impact relay jc-7/11/dc110v
体验碎周报第 102 期(2022.7.4)
报错cvc-complex-type.2.4.a: 发现了以元素 ‘base-extension‘ 开头的无效内容。应以 ‘{layoutlib}‘ 之一开头。
[Chongqing Guangdong education] electronic circuit homework question bank of RTVU secondary school
ES6 modularization
Common JS tool Libraries
Dimension and format of data
1、 Relevant theories and tools of network security penetration testing
Sleep quality today 78 points