Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
48f1a981
U
uni-app
项目概览
DCloud
/
uni-app
2 个月 前同步成功
通知
715
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
48f1a981
编写于
8月 02, 2019
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: 增加 optimization 配置说明
上级
ff9998f9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
52 addition
and
1 deletion
+52
-1
docs/collocation/manifest.md
docs/collocation/manifest.md
+52
-1
未找到文件。
docs/collocation/manifest.md
浏览文件 @
48f1a981
...
@@ -144,7 +144,9 @@ splash(启动封面)是App必然存在的、不可取消的。
...
@@ -144,7 +144,9 @@ splash(启动封面)是App必然存在的、不可取消的。
|async|Object|参考:
[
async
](
collocation/manifest?id=h5-async
)
|
|async|Object|参考:
[
async
](
collocation/manifest?id=h5-async
)
|
|devServer|Object|开发环境 server 配置,参考:
[
devServer
](
collocation/manifest?id=devserver
)
|
|devServer|Object|开发环境 server 配置,参考:
[
devServer
](
collocation/manifest?id=devserver
)
|
|publicPath|String|引用资源的地址前缀,仅发布时生效。参考:
[
publicPath
](
collocation/manifest?id=publicPath
)
|
|publicPath|String|引用资源的地址前缀,仅发布时生效。参考:
[
publicPath
](
collocation/manifest?id=publicPath
)
|
|sdkConfigs|String|SDK配置,例如地图... 参考:
[
sdkConfigs
](
collocation/manifest?id=h5sdkconfig
)
|
|sdkConfigs|String|SDK配置,例如地图... 参考:
[
sdkConfigs
](
collocation/manifest?id=h5sdkconfig
)
|
|optimization|Object|打包优化配置(HBuilderX 2.1.5 以上支持),参考
[
optimization
](
collocation/manifest?id=optimization
)
|
#### 自定义模板@h5-template
#### 自定义模板@h5-template
需要使用自定义模板的场景,通常有以下几种情况:
需要使用自定义模板的场景,通常有以下几种情况:
...
@@ -254,7 +256,56 @@ Tips:`uni-app` 中 `manifest.json->h5->devServer` 实际上对应 `webpack`
...
@@ -254,7 +256,56 @@ Tips:`uni-app` 中 `manifest.json->h5->devServer` 实际上对应 `webpack`
}
}
```
```
#### optimization
|属性|类型|默认值|说明|
|:-|:-|:-|:-|
|prefetch|Boolean|false|资源预取|
|preload|Boolean|false|资源预加载|
|treeShaking|Object||摇树优化,根据项目需求,动态打包框架所需的组件及API,保持框架代码最精简化,参考
[
treeShaking
](
collocation/manifest?id=treeshaking
)
|
##### treeShaking
|属性|类型|默认值|说明|
|:-|:-|:-|:-|
|enable|Boolean|false|是否启用摇树优化|
|modules|Object||需要优化的API模块列表|
**示例:**
```
json
"h5"
:
{
"optimization"
:
{
"enable"
:
true
,
"modules"
:
[
{
"name"
:
"network"
,
"title"
:
"网络"
,
"apiList"
:
[
"uni.request"
:
true
,
//配置为
true
,表示将会使用此API,不会被优化
"uni.downloadFile"
:
false
,
//配置为
false
,经过扫描项目中未使用此API的话,打包的后将不包含此API
...
]
}
]
}
}
```
**API模块列表:**
|模块(name)|说明(title)|包含的API(apiList)|
|:-|:-|:-|
|base|基础|uni.getSystemInfo、uni.getSystemInfoSync、uni.canIUse、uni.upx2px、uni.navigateTo、uni.redirectTo、uni.switchTab、uni.reLaunch、uni.navigateBack|
|network|网络|uni.request、uni.connectSocket、uni.sendSocketMessage、uni.closeSocket、uni.onSocketOpen、uni.onSocketError、uni.onSocketMessage、uni.onSocketClose、uni.downloadFile、uni.uploadFile|
|storage|数据缓存|uni.setStorage、uni.setStorageSync、uni.getStorage、uni.getStorageSync、uni.removeStorage、uni.removeStorageSync、uni.clearStorage、uni.clearStorageSync、uni.getStorageInfo、uni.getStorageInfoSync|
|location|位置|uni.getLocation、uni.openLocation、uni.chooseLocation|
|media|媒体|uni.chooseImage、uni.previewImage、uni.getImageInfo、uni.saveImageToPhotosAlbum、uni.compressImage、uni.getRecorderManager、uni.getBackgroundAudioManager、uni.createInnerAudioContext、uni.chooseVideo、uni.saveVideoToPhotosAlbum、uni.createVideoContext、uni.createCameraContext、uni.createLivePlayerContext|
|device|设备|uni.onMemoryWarning、uni.getNetworkType、uni.onNetworkStatusChange、uni.onAccelerometerChange、uni.startAccelerometer、uni.stopAccelerometer、uni.onCompassChange、uni.startCompass、uni.stopCompass、uni.onGyroscopeChange、uni.startGyroscope、uni.stopGyroscope、uni.makePhoneCall、uni.scanCode、uni.setClipboardData、uni.getClipboardData、uni.setScreenBrightness、uni.getScreenBrightness、uni.setKeepScreenOn、uni.onUserCaptureScreen、uni.vibrateLong、uni.vibrateShort、uni.addPhoneContact、uni.openBluetoothAdapter、uni.startBluetoothDevicesDiscovery、uni.onBluetoothDeviceFound、uni.stopBluetoothDevicesDiscovery、uni.onBluetoothAdapterStateChange、uni.getConnectedBluetoothDevices、uni.getBluetoothDevices、uni.getBluetoothAdapterState、uni.closeBluetoothAdapter、uni.writeBLECharacteristicValue、uni.readBLECharacteristicValue、uni.onBLEConnectionStateChange、uni.onBLECharacteristicValueChange、uni.notifyBLECharacteristicValueChange、uni.getBLEDeviceServices、uni.getBLEDeviceCharacteristics、uni.createBLEConnection、uni.closeBLEConnection、uni.onBeaconServiceChange、uni.onBeaconUpdate、uni.getBeacons、uni.startBeaconDiscovery、uni.stopBeaconDiscovery|
|ui|界面|uni.showToast、uni.hideToast、uni.showLoading、uni.hideLoading、uni.showModal、uni.showActionSheet、uni.setNavigationBarTitle、uni.setNavigationBarColor、uni.showNavigationBarLoading、uni.hideNavigationBarLoading、uni.setTabBarItem、uni.setTabBarStyle、uni.hideTabBar、uni.showTabBar、uni.setTabBarBadge、uni.removeTabBarBadge、uni.showTabBarRedDot、uni.hideTabBarRedDot、uni.setBackgroundColor、uni.setBackgroundTextStyle、uni.createAnimation、uni.pageScrollTo、uni.onWindowResize、uni.offWindowResize、uni.loadFontFace、uni.startPullDownRefresh、uni.stopPullDownRefresh、uni.createSelectorQuery、uni.createIntersectionObserver、uni.hideKeyboard|
|event|页面通讯|uni.$emit、uni.$on、uni.$once、uni.$off|
|file|文件|uni.saveFile、uni.getSavedFileList、uni.getSavedFileInfo、uni.removeSavedFile、uni.getFileInfo、uni.openDocument、uni.getFileSystemManager|
|canvas|绘画|uni.createOffscreenCanvas、uni.createCanvasContext、uni.canvasToTempFilePath、uni.canvasPutImageData、uni.canvasGetImageData|
|third|第三方服务|uni.getProvider、uni.login、uni.checkSession、uni.getUserInfo、uni.share、uni.showShareMenu、uni.hideShareMenu、uni.requestPayment、uni.subscribePush、uni.unsubscribePush、uni.onPush、uni.offPush、uni.requireNativePlugin、uni.base64ToArrayBuffer、uni.arrayBufferToBase64|
### mp-weixin
### mp-weixin
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录