Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qianlong66
uni-app
提交
de877b71
U
uni-app
项目概览
qianlong66
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
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,发现更多精彩内容 >>
提交
de877b71
编写于
8月 02, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(app): subNVue
上级
60d5a983
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
44 addition
and
6 deletion
+44
-6
packages/shims-uni-app.d.ts
packages/shims-uni-app.d.ts
+7
-0
packages/uni-cli-nvue/src/webpack/config/optimization.ts
packages/uni-cli-nvue/src/webpack/config/optimization.ts
+1
-0
packages/uni-cli-shared/src/json/app/pages/nvue.ts
packages/uni-cli-shared/src/json/app/pages/nvue.ts
+17
-5
packages/uni-cli-shared/src/json/pages.ts
packages/uni-cli-shared/src/json/pages.ts
+19
-0
packages/uni-h5-vite/src/index.ts
packages/uni-h5-vite/src/index.ts
+0
-1
未找到文件。
packages/shims-uni-app.d.ts
浏览文件 @
de877b71
...
...
@@ -161,6 +161,12 @@ declare namespace UniApp {
'
quickapp-webview-union
'
?:
PagesJsonPageStyle
}
interface
PagesJsonPageStyleSubNVue
{
id
?:
string
path
:
string
type
:
'
popup
'
|
'
navigationBar
'
style
?:
unknown
}
interface
PagesJsonPageStyle
extends
PagesJsonPagePlatformStyle
{
isNVue
?:
boolean
disableScroll
?:
boolean
...
...
@@ -174,6 +180,7 @@ declare namespace UniApp {
// app-plus
animationType
?:
string
animationDuration
?:
number
subNVues
?:
PagesJsonPageStyleSubNVue
[]
}
interface
PageRouteMeta
extends
PagesJsonPageStyle
{
id
?:
number
...
...
packages/uni-cli-nvue/src/webpack/config/optimization.ts
浏览文件 @
de877b71
...
...
@@ -5,6 +5,7 @@ export function createOptimization(): Configuration['optimization'] {
return
{
nodeEnv
:
false
,
// 禁用,由 define 统一设置
moduleIds
:
'
deterministic
'
,
chunkIds
:
'
deterministic
'
,
minimizer
:
[
new
TerserPlugin
({
terserOptions
:
{
...
...
packages/uni-cli-shared/src/json/app/pages/nvue.ts
浏览文件 @
de877b71
import
fs
from
'
fs
'
import
path
from
'
path
'
import
{
normalizePath
}
from
'
../../../utils
'
import
{
normalizePath
,
removeExt
}
from
'
../../../utils
'
export
function
initWebpackNVueEntry
(
pages
:
UniApp
.
PagesJsonPageOptions
[])
{
process
.
UNI_NVUE_ENTRY
=
{}
pages
.
forEach
((
page
)
=>
{
if
(
page
.
style
.
isNVue
)
{
process
.
UNI_NVUE_ENTRY
[
pa
ge
.
pa
th
]
=
genWebpackBase64Code
(
genNVueEntryCode
(
pa
ge
.
pa
th
)
pages
.
forEach
((
{
path
,
style
:
{
isNVue
,
subNVues
}
}
)
=>
{
if
(
isNVue
)
{
process
.
UNI_NVUE_ENTRY
[
path
]
=
genWebpackBase64Code
(
genNVueEntryCode
(
path
)
)
}
if
(
!
Array
.
isArray
(
subNVues
))
{
return
}
subNVues
.
forEach
(({
path
})
=>
{
if
(
!
path
)
{
return
}
const
subNVuePath
=
removeExt
(
path
.
split
(
'
?
'
)[
0
])
process
.
UNI_NVUE_ENTRY
[
subNVuePath
]
=
genWebpackBase64Code
(
genNVueEntryCode
(
subNVuePath
)
)
})
})
}
...
...
packages/uni-cli-shared/src/json/pages.ts
浏览文件 @
de877b71
...
...
@@ -94,6 +94,7 @@ function normalizeSubpackages(
if
(
root
&&
subPages
.
length
)
{
subPages
.
forEach
((
subPage
)
=>
{
subPage
.
path
=
normalizePath
(
path
.
join
(
root
,
subPage
.
path
))
subPage
.
style
=
normalizeSubpackageSubNVues
(
root
,
subPage
.
style
)
pages
.
push
(
subPage
)
})
}
...
...
@@ -102,6 +103,24 @@ function normalizeSubpackages(
return
pages
}
function
normalizeSubpackageSubNVues
(
root
:
string
,
style
:
UniApp
.
PagesJsonPageStyle
)
{
const
platformStyle
=
style
[
'
app
'
]
||
style
[
'
app-plus
'
]
if
(
!
platformStyle
)
{
return
style
}
if
(
Array
.
isArray
(
platformStyle
.
subNVues
))
{
platformStyle
.
subNVues
.
forEach
((
subNVue
)
=>
{
if
(
subNVue
.
path
)
{
subNVue
.
path
=
normalizePath
(
path
.
join
(
root
,
subNVue
.
path
))
}
})
}
return
style
}
function
normalizePageStyle
(
pagePath
:
string
|
null
,
pageStyle
:
UniApp
.
PagesJsonPageStyle
|
undefined
,
...
...
packages/uni-h5-vite/src/index.ts
浏览文件 @
de877b71
import
fs
from
'
fs
'
import
path
from
'
path
'
import
{
ResolvedConfig
}
from
'
vite
'
import
{
isInHBuilderX
,
UniVitePlugin
}
from
'
@dcloudio/uni-cli-shared
'
import
{
uniCssPlugin
}
from
'
./plugins/css
'
import
{
uniCssScopedPlugin
}
from
'
./plugins/cssScoped
'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录