截止到此时,我们整个的【慕课热搜】项目就已经全部开发完成了。
那么接下来我们就可以打包上线这个项目。
我们这里的打包会分为:
h5
两个平台的项目打包。
那么下面我们就分别来去看。
HBuilder
确认小程序名称和 appid
,确认无误点击 【发行】
等待控制台编译
点击【上传】即可
发布体验版:
访问体验版(仅限管理员、项目成员、体验成员):
不发布了,一个账号只能发布一个小程序,而这个项目只是用作学习罢了!
💡:上传后,预览体验版,页面空白
💡:小程序上传的项目配置项
{
"description": "项目配置文件。",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": true,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"useIsolateContext": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"showES6CompileOption": false,
"useCompilerPlugins": false
},
"compileType": "miniprogram",
"libVersion": "2.19.6",
"appid": "你的小程序 id",
"projectname": "imooc-blog",
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"staticServerOptions": {
"baseURL": "",
"servePath": ""
},
"isGameTourist": false,
"condition": {
"search": {
"list": []
},
"conversation": {
"list": []
},
"game": {
"list": []
},
"miniprogram": {
"list": []
}
}
}
💡:浏览文章时,代码高亮
选择代码高亮样式:
压缩 CSS 代码:
💡:主包超出限制
把 project.config.json
文件里边的minified
字段设置为 true
即可
➹:预览上传一直报错 Error: 系统错误,错误码:80200,main? - 微信开放社区
💡:打包上线不输出console.log
HBuilder
DCloud APPID
(可以重新获取),不填写这个无法打包index.html
进行访问,需要通过 web 服务
进行访问!打包到 Github:
本章节我们讲解了如何打包:
h5
客户端那么如果大家想要打包其他平台应用的话,也非常简单,同样在发行下点击对应的按钮即可。