当前位置:网站首页>uniapp 自定義環境變量
uniapp 自定義環境變量
2022-07-04 06:23:00 【@時空旅人】
1、在根目錄下創建 package.json 文件,寫入以下內容,具體配置項參考官網 package.json
{
"uni-app": {
"scripts": {
"dev": {
// 配置項名稱
"title":"h5測試環境", // 在菜單工具欄上的名稱
"env": {
"UNI_PLATFORM": "h5" // 平臺
},
"define": {
"H5-DEV": true // 變量名
}
},
"prod": {
"title":"h5生產環境",
"env": {
"UNI_PLATFORM": "h5"
},
"define": {
"H5-PROD": true
}
}
}
}
}
2、使用環境變量
// #ifdef H5-DEV
console.log('dev')
// #endif
// #ifdef H5-PROD
console.log('prod')
// #endif
3、編譯打包

边栏推荐
- How to expand all collapse panels
- Grounding relay dd-1/60
- 2022.7.2-----leetcode.871
- Experience weekly report no. 102 (July 4, 2022)
- 746. Climb stairs with minimum cost
- Detectron: train your own data set -- convert your own data format to coco format
- C实现贪吃蛇小游戏
- 测试岗的中年危机该如何选择?是坚守还是另寻出路?且看下文
- 2022.7.3-----leetcode. five hundred and fifty-six
- Considerations for testing a website
猜你喜欢

C实现贪吃蛇小游戏

How does apscheduler set tasks not to be concurrent (that is, execute the next task after the first one)?

SQL injection SQL lab 11~22

SQL join, left join, right join usage

配置交叉编译工具链和环境变量

HMS v1.0 appointment. PHP editid parameter SQL injection vulnerability (cve-2022-25491)

Notes and notes

A little understanding of GSLB (global server load balance) technology

Impact relay jc-7/11/dc110v

Practical gadget instructions
随机推荐
注释与注解
70000 words of detailed explanation of the whole process of pad openvino [CPU] - from environment configuration to model deployment
How to implement cross domain requests
Leakage detection relay jy82-2p
Review | categories and mechanisms of action of covid-19 neutralizing antibodies and small molecule drugs
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
Which water in the environment needs water quality monitoring
SQL join, left join, right join usage
Sleep quality today 78 points
Considerations for testing a website
Stc8h development (XII): I2C drive AT24C08, at24c32 series EEPROM storage
Tsinghua University product: penalty gradient norm improves generalization of deep learning model
云原生——上云必读之SSH篇(常用于远程登录云服务器)
R统计绘图-随机森林分类分析及物种丰度差异检验组合图
Distributed cap theory
手动对list进行分页(参数list ,当前页,页面大小)
win10清除快速访问-不留下痕迹
Tf/pytorch/cafe-cv/nlp/ audio - practical demonstration of full ecosystem CPU deployment - Intel openvino tool suite course summary (Part 2)
Weekly summary (*63): about positive energy
509. Fibonacci number, all paths of climbing stairs, minimum cost of climbing stairs