Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
c0ca4bf8
U
uni-app
项目概览
陈庄旺
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c0ca4bf8
编写于
9月 04, 2019
作者:
M
mehaotian
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/dcloudio/uni-app
into dev
上级
041e4a40
6b0ea16e
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
30 addition
and
19 deletion
+30
-19
packages/uni-cli-shared/lib/pages.js
packages/uni-cli-shared/lib/pages.js
+8
-7
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+11
-5
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js
.../webpack-uni-pages-loader/lib/platforms/app-plus/index.js
+8
-6
packages/webpack-uni-pages-loader/lib/platforms/mp.js
packages/webpack-uni-pages-loader/lib/platforms/mp.js
+3
-1
未找到文件。
packages/uni-cli-shared/lib/pages.js
浏览文件 @
c0ca4bf8
...
@@ -82,9 +82,9 @@ function processPagesJson (pagesJson, loader = {
...
@@ -82,9 +82,9 @@ function processPagesJson (pagesJson, loader = {
})
})
}
}
if
(
Object
.
keys
(
uniNVuePages
)
.
length
)
{
// 直接挂在 pagesJson 上
if
(
uniNVuePages
.
length
)
{
// 直接挂在 pagesJson 上
pagesJson
.
nvue
=
{
pagesJson
.
nvue
=
{
pages
:
uniNVuePages
pages
:
uniNVuePages
.
reverse
()
}
}
if
(
uniNVueEntryPagePath
)
{
if
(
uniNVueEntryPagePath
)
{
pagesJson
.
nvue
.
entryPagePath
=
uniNVueEntryPagePath
pagesJson
.
nvue
.
entryPagePath
=
uniNVueEntryPagePath
...
@@ -152,9 +152,10 @@ function isValidPage (page, root = '') {
...
@@ -152,9 +152,10 @@ function isValidPage (page, root = '') {
// process.UNI_NVUE_ENTRY[pagePath] = path.resolve(process.env.UNI_INPUT_DIR, pagePath + '.nvue') + '?entry'
// process.UNI_NVUE_ENTRY[pagePath] = path.resolve(process.env.UNI_INPUT_DIR, pagePath + '.nvue') + '?entry'
// }
// }
uniNVuePages
[
pagePath
+
'
.html
'
]
=
{
uniNVuePages
.
push
({
'
window
'
:
page
.
style
||
{}
'
path
'
:
pagePath
+
'
.html
'
,
}
'
style
'
:
page
.
style
||
{}
})
return
false
return
false
}
}
...
@@ -176,7 +177,7 @@ function getNVueMainJsPath (page) {
...
@@ -176,7 +177,7 @@ function getNVueMainJsPath (page) {
process
.
UNI_ENTRY
=
{}
process
.
UNI_ENTRY
=
{}
process
.
UNI_NVUE_ENTRY
=
{}
process
.
UNI_NVUE_ENTRY
=
{}
let
uniNVuePages
=
{}
const
uniNVuePages
=
[]
function
parsePages
(
pagesJson
,
pageCallback
,
subPageCallback
)
{
function
parsePages
(
pagesJson
,
pageCallback
,
subPageCallback
)
{
if
(
!
pagesJson
)
{
if
(
!
pagesJson
)
{
...
@@ -215,7 +216,7 @@ function parseEntry (pagesJson) {
...
@@ -215,7 +216,7 @@ function parseEntry (pagesJson) {
process
.
UNI_NVUE_ENTRY
[
'
app-service
'
]
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
getMainEntry
())
process
.
UNI_NVUE_ENTRY
[
'
app-service
'
]
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
getMainEntry
())
}
}
uniNVuePages
=
{}
uniNVuePages
.
length
=
0
if
(
!
pagesJson
)
{
if
(
!
pagesJson
)
{
pagesJson
=
getPagesJson
()
// 会检测修改 nvue entry
pagesJson
=
getPagesJson
()
// 会检测修改 nvue entry
...
...
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
c0ca4bf8
...
@@ -140,15 +140,21 @@ if (platformOptions.usingComponents === true) {
...
@@ -140,15 +140,21 @@ if (platformOptions.usingComponents === true) {
}
}
if
(
if
(
process
.
env
.
NODE_ENV
===
'
production
'
&&
process
.
env
.
UNI_USING_COMPONENTS
||
(
process
.
env
.
UNI_USING_COMPONENTS
||
process
.
env
.
UNI_PLATFORM
===
'
h5
'
)
process
.
env
.
UNI_PLATFORM
===
'
h5
'
)
{
// 自定义组件模式或 h5 平台
)
{
// 自定义组件模式或 h5 平台
const
uniStatistics
=
Object
.
assign
(
const
uniStatistics
=
Object
.
assign
(
manifestJsonObj
.
uniStatistics
||
{},
manifestJsonObj
.
uniStatistics
||
{},
platformOptions
.
uniStatistics
||
{}
platformOptions
.
uniStatistics
||
{}
)
)
if
(
uniStatistics
.
enable
!==
false
)
{
if
(
uniStatistics
.
enable
!==
false
&&
(
process
.
env
.
NODE_ENV
===
'
production
'
||
uniStatistics
.
enable
===
'
development
'
)
)
{
if
(
process
.
UNI_STAT_CONFIG
.
appid
)
{
if
(
process
.
UNI_STAT_CONFIG
.
appid
)
{
process
.
env
.
UNI_USING_STAT
=
true
process
.
env
.
UNI_USING_STAT
=
true
}
else
{
}
else
{
...
...
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js
浏览文件 @
c0ca4bf8
...
@@ -128,12 +128,14 @@ module.exports = function (pagesJson, userManifestJson) {
...
@@ -128,12 +128,14 @@ module.exports = function (pagesJson, userManifestJson) {
const
nvuePages
=
pagesJson
.
nvue
&&
pagesJson
.
nvue
.
pages
const
nvuePages
=
pagesJson
.
nvue
&&
pagesJson
.
nvue
.
pages
const
nvuePagePaths
=
Object
.
keys
(
nvuePages
||
{})
if
(
nvuePages
.
length
)
{
if
(
nvuePagePaths
.
length
)
{
const
pages
=
{}
const
pages
=
{}
nvuePagePaths
.
forEach
(
nvuePagePath
=>
{
nvuePages
.
forEach
(({
pages
[
nvuePagePath
]
=
{
path
,
'
window
'
:
parseStyle
(
pagesJson
.
nvue
.
pages
[
nvuePagePath
][
'
window
'
]
||
{}),
style
})
=>
{
pages
[
path
]
=
{
'
window
'
:
parseStyle
(
style
),
'
nvue
'
:
true
'
nvue
'
:
true
}
}
})
})
...
@@ -319,7 +321,7 @@ module.exports = function (pagesJson, userManifestJson) {
...
@@ -319,7 +321,7 @@ module.exports = function (pagesJson, userManifestJson) {
// networkTimeout
// networkTimeout
normalizeNetworkTimeout
(
appJson
)
normalizeNetworkTimeout
(
appJson
)
appJson
.
page
=
Object
.
create
(
null
)
appJson
.
page
=
Object
.
create
(
null
)
appJson
.
pages
=
Object
.
keys
(
appJson
.
nvue
.
pages
).
reverse
().
map
(
pagePath
=>
{
appJson
.
pages
=
Object
.
keys
(
appJson
.
nvue
.
pages
).
map
(
pagePath
=>
{
const
newPagePath
=
pagePath
.
replace
(
'
.html
'
,
''
)
const
newPagePath
=
pagePath
.
replace
(
'
.html
'
,
''
)
appJson
.
page
[
newPagePath
]
=
{
appJson
.
page
[
newPagePath
]
=
{
window
:
appJson
.
nvue
.
pages
[
pagePath
].
window
,
window
:
appJson
.
nvue
.
pages
[
pagePath
].
window
,
...
...
packages/webpack-uni-pages-loader/lib/platforms/mp.js
浏览文件 @
c0ca4bf8
...
@@ -44,7 +44,9 @@ const pagesJson2AppJson = {
...
@@ -44,7 +44,9 @@ const pagesJson2AppJson = {
fromJson
&&
fromJson
&&
fromJson
.
nvue
&&
fromJson
.
nvue
&&
fromJson
.
nvue
.
pages
&&
fromJson
.
nvue
.
pages
&&
fromJson
.
nvue
.
pages
[
page
.
pagePath
+
'
.html
'
]
fromJson
.
nvue
.
pages
.
find
(({
path
})
=>
path
===
(
page
.
pagePath
+
'
.html
'
))
)
)
)
{
)
{
console
.
error
(
console
.
error
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录