当前位置:网站首页>uniapp开发,打包成H5部署到服务器
uniapp开发,打包成H5部署到服务器
2022-07-06 00:18:00 【马小跳的Coding进阶之路】
前端使用uniapp开发项目完成后,需要将页面打包,生成H5的静态文件,部署在服务器上。
这样通过服务器链接地址,直接可以在手机上点开来访问。
打包全步骤如下:
一、点击菜单栏“发行”,点击选择“网站-PC Web或手机H5”,

二、填写网站标题和网站域名/服务器的IP地址。
(这个地址是将项目打包之后存放静态文件的地址)

三、点击进入manifest.json的h5配置里,根据自己的情况配置一些信息。
一定要注意配置 “运行的基础路径”,如果出现空白页面或者静态文件404的情况,可能是因为这个路径没有配置好。

四、点击发行,控制台会自动编译。出现以下提示,说明编译成功:

五、点击上图中的红框部分,就能看到已经打包好的静态页面了。(直接把这个h5文件压缩一下,发给后端就可以了)

如需要自己上传到服务器上,可继续以下步骤。
六、先拿到服务器的地址信息,找一个工具,连接上该项目的服务器,进入到服务器的根目录底下。
我这里用的是ftp工具。在根目录底下新建一个aofan文件夹,然后将上图中的static文件夹和index.html复制进去即可。
OK,这个时候就已经部署成功了。
七、打开浏览器,输入服务器ip地址,访问一下index.html的内容即可。
注意点:这三个地方的路径名称一定要一致。
1:打包时候的配置的运行的基础路径
2:服务器根目录底下存放静态文件static和index.html
3:浏览器里面访问的路径

边栏推荐
- 云呐|公司固定资产管理系统有哪些?
- DEJA_ Vu3d - cesium feature set 055 - summary description of map service addresses of domestic and foreign manufacturers
- 常用API类及异常体系
- [gym 102832h] [template] combination lock (bipartite game)
- Date类中日期转成指定字符串出现的问题及解决方法
- Go learning --- structure to map[string]interface{}
- Yunna | what are the main operating processes of the fixed assets management system
- mysql-全局锁和表锁
- Configuring OSPF load sharing for Huawei devices
- [noi simulation] Anaid's tree (Mobius inversion, exponential generating function, Ehrlich sieve, virtual tree)
猜你喜欢
随机推荐
Single merchant v4.4 has the same original intention and strength!
云呐|公司固定资产管理系统有哪些?
JS can really prohibit constant modification this time!
Tools to improve work efficiency: the idea of SQL batch generation tools
FFMPEG关键结构体——AVCodecContext
Key structure of ffmpeg - avframe
LeetCode 6006. Take out the least number of magic beans
Global and Chinese markets for pressure and temperature sensors 2022-2028: Research Report on technology, participants, trends, market size and share
建立时间和保持时间的模型分析
微信小程序---WXML 模板语法(附带笔记文档)
FFT learning notes (I think it is detailed)
Ffmpeg learning - core module
云呐|固定资产管理系统主要操作流程有哪些
Single source shortest path exercise (I)
Hudi of data Lake (1): introduction to Hudi
Global and Chinese markets for hinged watertight doors 2022-2028: Research Report on technology, participants, trends, market size and share
Key structure of ffmpeg -- AVCodecContext
[gym 102832h] [template] combination lock (bipartite game)
Configuring OSPF GR features for Huawei devices
XML配置文件









