当前位置:网站首页>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 QTableWidget 表格列置顶需求的思路和代码
- 27-31. Dependency transitivity, principle
- 分布式CAP理论
- buuctf-pwn write-ups (8)
- Sleep quality today 78 points
- C language exercises (recursion)
- Inputstream/outputstream (input and output of file)
- 剑指 Offer II 038. 每日温度
- C realize Snake games
- How to solve the component conflicts caused by scrollbars in GridView
猜你喜欢

Json Web token - jwt vs. Traditional session login Authentication

C语言中的函数(详解)

Appium foundation - appium installation (II)

分布式CAP理论

win10清除快速访问-不留下痕迹

Detectron: train your own data set -- convert your own data format to coco format

My NVIDIA developer journey - optimizing graphics card performance

js arguments参数使用和详解

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

509. Fibonacci number, all paths of climbing stairs, minimum cost of climbing stairs
随机推荐
InputStream/OutputStream(文件的输入输出)
Which water in the environment needs water quality monitoring
2022.7.3-----leetcode.556
Sword finger offer II 038 Daily temperature
How to implement lazy loading in El select (with search function)
《ClickHouse原理解析与应用实践》读书笔记(4)
C實現貪吃蛇小遊戲
198. House raiding
The difference between PX EM rem
Leakage detection relay jy82-2p
C语言中的排序,实现从小到大的数字排序法
746. Climb stairs with minimum cost
Fast power (template)
Internet of things protocol ZigBee ZigBee module uses the concept of protocol stack
How to expand all collapse panels
Matlab remainder
Arcpy uses the updatelayer function to change the symbol system of the layer
APScheduler如何设置任务不并发(即第一个任务执行完再执行下一个)?
LayoutManager布局管理器:FlowLayout、BorderLayout、GridLayout、GridBagLayout、CardLayout、BoxLayout
C realize Snake games