Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
20岁爱吃必胜客
uni-app
提交
1e02476b
U
uni-app
项目概览
20岁爱吃必胜客
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1e02476b
编写于
1月 09, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 解决开启 treeShaking 后 uni.previewImage 失效的问题 fixed #1168
上级
acdf149a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
3 deletion
+24
-3
build/manifest.js
build/manifest.js
+3
-1
packages/vue-cli-plugin-uni-optimize/packages/webpack-optimize-plugin/api.js
...ugin-uni-optimize/packages/webpack-optimize-plugin/api.js
+21
-2
未找到文件。
build/manifest.js
浏览文件 @
1e02476b
...
@@ -31,6 +31,8 @@ const DEPS = {
...
@@ -31,6 +31,8 @@ const DEPS = {
[
'
/platforms/h5/components/system-routes/open-location/index.vue
'
,
'
OpenLocation
'
]
[
'
/platforms/h5/components/system-routes/open-location/index.vue
'
,
'
OpenLocation
'
]
],
],
'
previewImage
'
:
[
'
previewImage
'
:
[
[
'
/core/view/components/swiper/index.vue
'
,
'
Swiper
'
],
[
'
/core/view/components/swiper-item/index.vue
'
,
'
SwiperItem
'
],
[
'
/platforms/h5/components/system-routes/preview-image/index.vue
'
,
'
PreviewImage
'
]
[
'
/platforms/h5/components/system-routes/preview-image/index.vue
'
,
'
PreviewImage
'
]
],
],
'
showToast
'
:
TOAST_DEPS
,
'
showToast
'
:
TOAST_DEPS
,
...
@@ -138,4 +140,4 @@ module.exports = {
...
@@ -138,4 +140,4 @@ module.exports = {
JSON
.
stringify
(
manifestJson
,
null
,
4
)
JSON
.
stringify
(
manifestJson
,
null
,
4
)
)
)
}
}
}
}
packages/vue-cli-plugin-uni-optimize/packages/webpack-optimize-plugin/api.js
浏览文件 @
1e02476b
const
fs
=
require
(
'
fs
'
)
const
fs
=
require
(
'
fs
'
)
const
path
=
require
(
'
path
'
)
const
path
=
require
(
'
path
'
)
const
updateComponents
=
require
(
'
./component
'
)
const
tmpDir
=
path
.
resolve
(
__dirname
,
'
../../.tmp
'
)
const
tmpDir
=
path
.
resolve
(
__dirname
,
'
../../.tmp
'
)
...
@@ -72,6 +73,12 @@ function updateAppComponents(paths) {
...
@@ -72,6 +73,12 @@ function updateAppComponents(paths) {
return
updateExportDefaultObject
(
paths
,
'
app-components.js
'
,
false
)
return
updateExportDefaultObject
(
paths
,
'
app-components.js
'
,
false
)
}
}
function
updateCoreComponents
(
paths
){
const
tags
=
process
.
UNI_TAGS
||
new
Set
()
Object
.
keys
(
paths
).
forEach
(
tag
=>
tags
.
add
(
tag
.
replace
(
/
([
a-z
])([
A-Z
])
/g
,
'
$1-$2
'
).
toLowerCase
()))
updateComponents
(
tags
)
}
function
updateAppMixins
(
paths
)
{
function
updateAppMixins
(
paths
)
{
return
updateExportDefaultObject
(
paths
,
'
app-mixins.js
'
,
false
,
true
)
return
updateExportDefaultObject
(
paths
,
'
app-mixins.js
'
,
false
,
true
)
}
}
...
@@ -93,6 +100,11 @@ const isAppComponents = filepath => {
...
@@ -93,6 +100,11 @@ const isAppComponents = filepath => {
filepath
.
indexOf
(
'
/platforms/
'
+
process
.
env
.
UNI_PLATFORM
+
'
/components/app/
'
)
===
0
filepath
.
indexOf
(
'
/platforms/
'
+
process
.
env
.
UNI_PLATFORM
+
'
/components/app/
'
)
===
0
}
}
const
isCoreComponents
=
filepath
=>
{
return
path
.
extname
(
filepath
)
===
'
.vue
'
&&
filepath
.
indexOf
(
'
/core/view/components/
'
)
===
0
}
const
isAppMixins
=
filepath
=>
{
const
isAppMixins
=
filepath
=>
{
return
path
.
extname
(
filepath
)
===
'
.js
'
&&
return
path
.
extname
(
filepath
)
===
'
.js
'
&&
filepath
.
indexOf
(
'
/platforms/
'
+
process
.
env
.
UNI_PLATFORM
+
'
/components/app/
'
)
===
0
filepath
.
indexOf
(
'
/platforms/
'
+
process
.
env
.
UNI_PLATFORM
+
'
/components/app/
'
)
===
0
...
@@ -113,6 +125,7 @@ function parseDeps(apis, manifest) {
...
@@ -113,6 +125,7 @@ function parseDeps(apis, manifest) {
const
apiProtocolPaths
=
Object
.
create
(
null
)
const
apiProtocolPaths
=
Object
.
create
(
null
)
const
invokeApiPaths
=
Object
.
create
(
null
)
const
invokeApiPaths
=
Object
.
create
(
null
)
const
appComponentsPaths
=
Object
.
create
(
null
)
const
appComponentsPaths
=
Object
.
create
(
null
)
const
coreComponentsPaths
=
Object
.
create
(
null
)
const
appMixinsPaths
=
Object
.
create
(
null
)
const
appMixinsPaths
=
Object
.
create
(
null
)
const
systemRoutesPaths
=
Object
.
create
(
null
)
const
systemRoutesPaths
=
Object
.
create
(
null
)
const
apiSubscribePaths
=
Object
.
create
(
null
)
const
apiSubscribePaths
=
Object
.
create
(
null
)
...
@@ -126,6 +139,9 @@ function parseDeps(apis, manifest) {
...
@@ -126,6 +139,9 @@ function parseDeps(apis, manifest) {
},
{
},
{
test
:
isAppComponents
,
test
:
isAppComponents
,
paths
:
appComponentsPaths
paths
:
appComponentsPaths
},
{
test
:
isCoreComponents
,
paths
:
coreComponentsPaths
},
{
},
{
test
:
isAppMixins
,
test
:
isAppMixins
,
paths
:
appMixinsPaths
paths
:
appMixinsPaths
...
@@ -159,7 +175,7 @@ function parseDeps(apis, manifest) {
...
@@ -159,7 +175,7 @@ function parseDeps(apis, manifest) {
})
})
if
(
strategy
)
{
if
(
strategy
)
{
strategy
.
paths
[
exports
]
=
filepath
strategy
.
paths
[
exports
]
=
filepath
}
else
{
}
else
{
console
.
log
(
'
dep
'
,
name
,
dep
)
console
.
log
(
'
dep
'
,
name
,
dep
)
console
.
warn
(
`
${
filepath
}
未识别`
)
console
.
warn
(
`
${
filepath
}
未识别`
)
}
}
...
@@ -175,6 +191,7 @@ function parseDeps(apis, manifest) {
...
@@ -175,6 +191,7 @@ function parseDeps(apis, manifest) {
apiProtocolPaths
,
apiProtocolPaths
,
invokeApiPaths
,
invokeApiPaths
,
appComponentsPaths
,
appComponentsPaths
,
coreComponentsPaths
,
appMixinsPaths
,
appMixinsPaths
,
systemRoutesPaths
,
systemRoutesPaths
,
apiSubscribePaths
apiSubscribePaths
...
@@ -203,6 +220,7 @@ module.exports = function updateApis(apis = new Set(), userApis = new Set()) {
...
@@ -203,6 +220,7 @@ module.exports = function updateApis(apis = new Set(), userApis = new Set()) {
invokeApiPaths
,
invokeApiPaths
,
apiSubscribePaths
,
apiSubscribePaths
,
appComponentsPaths
,
appComponentsPaths
,
coreComponentsPaths
,
appMixinsPaths
,
appMixinsPaths
,
systemRoutesPaths
systemRoutesPaths
}
=
parseDeps
(
apis
,
manifest
)
}
=
parseDeps
(
apis
,
manifest
)
...
@@ -214,6 +232,7 @@ module.exports = function updateApis(apis = new Set(), userApis = new Set()) {
...
@@ -214,6 +232,7 @@ module.exports = function updateApis(apis = new Set(), userApis = new Set()) {
updateInvokeApi
(
invokeApiPaths
)
updateInvokeApi
(
invokeApiPaths
)
updateAppComponents
(
appComponentsPaths
)
updateAppComponents
(
appComponentsPaths
)
updateCoreComponents
(
coreComponentsPaths
)
updateAppMixins
(
appMixinsPaths
)
updateAppMixins
(
appMixinsPaths
)
updateSystemRoutes
(
systemRoutesPaths
)
updateSystemRoutes
(
systemRoutesPaths
)
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录