Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Velpro187
uni-app
提交
cd26c9fc
U
uni-app
项目概览
Velpro187
/
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,发现更多精彩内容 >>
提交
cd26c9fc
编写于
8月 27, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(h5): file path with white space
上级
99e1c891
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
78 addition
and
63 deletion
+78
-63
.prettierignore
.prettierignore
+1
-0
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+1
-1
packages/uni-app-vite/src/plugin/build.ts
packages/uni-app-vite/src/plugin/build.ts
+3
-0
packages/uni-automator/lib/uni.plugin.js
packages/uni-automator/lib/uni.plugin.js
+39
-55
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+3
-0
packages/uni-shared/dist/uni-shared.cjs.js
packages/uni-shared/dist/uni-shared.cjs.js
+2
-1
packages/uni-shared/dist/uni-shared.es.js
packages/uni-shared/dist/uni-shared.es.js
+2
-1
packages/uni-shared/src/hbx/formatLog.ts
packages/uni-shared/src/hbx/formatLog.ts
+2
-1
packages/uni-stat/dist/uni-stat.cjs.js
packages/uni-stat/dist/uni-stat.cjs.js
+1
-1
packages/uni-stat/dist/uni-stat.es.js
packages/uni-stat/dist/uni-stat.es.js
+1
-1
packages/vite-plugin-uni/src/configResolved/plugins/resolveId.ts
...s/vite-plugin-uni/src/configResolved/plugins/resolveId.ts
+23
-2
未找到文件。
.prettierignore
浏览文件 @
cd26c9fc
dist
packages/uni-app-vite/lib
packages/uni-app-vue/lib
packages/uni-automator/lib
packages/uni-cli-nvue/lib
packages/uni-cli-shared/lib
packages/uni-components/lib
...
...
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
cd26c9fc
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
packages/uni-app-vite/src/plugin/build.ts
浏览文件 @
cd26c9fc
...
...
@@ -25,6 +25,9 @@ export function buildOptions(): UserConfig['build'] {
output
:
{
name
:
'
AppService
'
,
format
:
process
.
env
.
UNI_APP_CODE_SPLITING
?
'
amd
'
:
'
iife
'
,
amd
:
{
autoId
:
true
,
},
entryFileNames
:
'
app-service.js
'
,
sourcemapPathTransform
(
relativeSourcePath
,
sourcemapPath
)
{
const
sourcePath
=
normalizePath
(
...
...
packages/uni-automator/lib/uni.plugin.js
浏览文件 @
cd26c9fc
'
use strict
'
var
__importDefault
=
(
this
&&
this
.
__importDefault
)
||
function
(
mod
)
{
return
mod
&&
mod
.
__esModule
?
mod
:
{
default
:
mod
}
}
Object
.
defineProperty
(
exports
,
'
__esModule
'
,
{
value
:
true
})
const
fs_extra_1
=
__importDefault
(
require
(
'
fs-extra
'
))
const
path_1
=
__importDefault
(
require
(
'
path
'
))
const
uni_cli_shared_1
=
require
(
'
@dcloudio/uni-cli-shared
'
)
"
use strict
"
;
var
__importDefault
=
(
this
&&
this
.
__importDefault
)
||
function
(
mod
)
{
return
(
mod
&&
mod
.
__esModule
)
?
mod
:
{
"
default
"
:
mod
};
};
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
const
fs_extra_1
=
__importDefault
(
require
(
"
fs-extra
"
));
const
path_1
=
__importDefault
(
require
(
"
path
"
));
const
uni_cli_shared_1
=
require
(
"
@dcloudio/uni-cli-shared
"
);
exports
.
default
=
[
uni_cli_shared_1
.
defineUniMainJsPlugin
((
opts
)
=>
{
return
{
name
:
'
vite:uni-automator
'
,
enforce
:
'
pre
'
,
configResolved
()
{
if
(
!
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
{
return
}
const
pkg
=
JSON
.
parse
(
fs_extra_1
.
default
.
readFileSync
(
path_1
.
default
.
resolve
(
__dirname
,
'
../package.json
'
),
'
utf8
'
)
)
const
automatorJson
=
JSON
.
stringify
({
version
:
pkg
.
version
,
wsEndpoint
:
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
,
})
fs_extra_1
.
default
.
outputFileSync
(
path_1
.
default
.
resolve
(
process
.
env
.
UNI_OUTPUT_DIR
,
'
../.automator/
'
+
process
.
env
.
UNI_PLATFORM
+
'
/.automator.json
'
),
automatorJson
)
},
transform
(
code
,
id
)
{
if
(
!
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
{
return
null
}
if
(
opts
.
filter
(
id
))
{
const
platform
=
process
.
env
.
UNI_PLATFORM
return
{
code
:
code
+
`;import '@dcloudio/uni-
${
platform
===
'
app
'
?
'
app-plus
'
:
platform
}
/lib/automator.js';`
,
map
:
null
,
}
}
},
}
}),
]
uni_cli_shared_1
.
defineUniMainJsPlugin
((
opts
)
=>
{
return
{
name
:
'
vite:uni-automator
'
,
enforce
:
'
pre
'
,
configResolved
()
{
if
(
!
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
{
return
;
}
const
pkg
=
JSON
.
parse
(
fs_extra_1
.
default
.
readFileSync
(
path_1
.
default
.
resolve
(
__dirname
,
'
../package.json
'
),
'
utf8
'
));
const
automatorJson
=
JSON
.
stringify
({
version
:
pkg
.
version
,
wsEndpoint
:
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
,
});
fs_extra_1
.
default
.
outputFileSync
(
path_1
.
default
.
resolve
(
process
.
env
.
UNI_OUTPUT_DIR
,
'
../.automator/
'
+
process
.
env
.
UNI_PLATFORM
+
'
/.automator.json
'
),
automatorJson
);
},
transform
(
code
,
id
)
{
if
(
!
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
{
return
null
;
}
if
(
opts
.
filter
(
id
))
{
const
platform
=
process
.
env
.
UNI_PLATFORM
;
return
{
code
:
code
+
`;import '@dcloudio/uni-
${
platform
===
'
app
'
?
'
app-plus
'
:
platform
}
/lib/automator.js';`
,
map
:
null
,
};
}
},
};
}),
];
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
cd26c9fc
...
...
@@ -683,6 +683,9 @@ function useCurrentPageId() {
return getCurrentInstance().root.proxy.$page.id;
}
function getPageIdByVm(vm) {
if (vm.$page) {
return vm.$page.id;
}
if (!vm.$) {
return;
}
...
...
packages/uni-shared/dist/uni-shared.cjs.js
浏览文件 @
cd26c9fc
...
...
@@ -396,7 +396,8 @@ function normalizeLog(type, filename, args) {
return
msgs
.
join
(
'
---COMMA---
'
)
+
'
'
+
filename
;
}
function
formatAppLog
(
type
,
filename
,
...
args
)
{
console
[
type
](
normalizeLog
(
type
,
filename
,
args
));
const
res
=
normalizeLog
(
type
,
filename
,
args
);
res
&&
console
[
type
](
res
);
}
function
plusReady
(
callback
)
{
...
...
packages/uni-shared/dist/uni-shared.es.js
浏览文件 @
cd26c9fc
...
...
@@ -392,7 +392,8 @@ function normalizeLog(type, filename, args) {
return
msgs
.
join
(
'
---COMMA---
'
)
+
'
'
+
filename
;
}
function
formatAppLog
(
type
,
filename
,
...
args
)
{
console
[
type
](
normalizeLog
(
type
,
filename
,
args
));
const
res
=
normalizeLog
(
type
,
filename
,
args
);
res
&&
console
[
type
](
res
);
}
function
plusReady
(
callback
)
{
...
...
packages/uni-shared/src/hbx/formatLog.ts
浏览文件 @
cd26c9fc
...
...
@@ -59,5 +59,6 @@ export function formatAppLog(
filename
:
string
,
...
args
:
unknown
[]
)
{
console
[
type
](
normalizeLog
(
type
,
filename
,
args
))
const
res
=
normalizeLog
(
type
,
filename
,
args
)
res
&&
console
[
type
](
res
)
}
packages/uni-stat/dist/uni-stat.cjs.js
浏览文件 @
cd26c9fc
'
use strict
'
;
var
version
=
"
3.0.0-alpha-30000202108
13002
"
;
var
version
=
"
3.0.0-alpha-30000202108
26001
"
;
const
STAT_VERSION
=
version
;
const
STAT_URL
=
'
https://tongji.dcloud.io/uni/stat
'
;
...
...
packages/uni-stat/dist/uni-stat.es.js
浏览文件 @
cd26c9fc
var
version
=
"
3.0.0-alpha-30000202108
13002
"
;
var
version
=
"
3.0.0-alpha-30000202108
26001
"
;
const
STAT_VERSION
=
version
;
const
STAT_URL
=
'
https://tongji.dcloud.io/uni/stat
'
;
...
...
packages/vite-plugin-uni/src/configResolved/plugins/resolveId.ts
浏览文件 @
cd26c9fc
...
...
@@ -2,8 +2,13 @@ import fs from 'fs'
import
path
from
'
path
'
import
debug
from
'
debug
'
import
{
Plugin
}
from
'
vite
'
import
{
parseVueRequest
,
resolveBuiltIn
}
from
'
@dcloudio/uni-cli-shared
'
import
{
unescape
}
from
'
querystring
'
import
{
isInHBuilderX
,
normalizePath
,
parseVueRequest
,
resolveBuiltIn
,
}
from
'
@dcloudio/uni-cli-shared
'
import
{
VitePluginUniResolvedOptions
}
from
'
../..
'
...
...
@@ -22,6 +27,15 @@ const BUILT_IN_MODULES = {
export
type
BuiltInModulesKey
=
keyof
typeof
BUILT_IN_MODULES
const
FS_PREFIX
=
`/@fs/`
const
VOLUME_RE
=
/^
[
A-Z
]
:/i
function
fsPathFromId
(
id
:
string
)
{
const
fsPath
=
normalizePath
(
id
.
slice
(
FS_PREFIX
.
length
))
return
fsPath
.
startsWith
(
'
/
'
)
||
fsPath
.
match
(
VOLUME_RE
)
?
fsPath
:
`/
${
fsPath
}
`
}
export
function
uniResolveIdPlugin
(
options
:
VitePluginUniResolvedOptions
):
Plugin
{
...
...
@@ -39,6 +53,13 @@ export function uniResolveIdPlugin(
path
.
join
(
id
,
BUILT_IN_MODULES
[
id
as
BuiltInModulesKey
])
))
}
if
(
isInHBuilderX
())
{
// 解决文件路径包含转义字符(空格)等
// /@fs/Applications/HBuilderX%20Alpha.app/Contents/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/client/env.mjs
if
(
id
.
startsWith
(
FS_PREFIX
)
&&
id
.
includes
(
'
uniapp-cli-vite
'
))
{
return
fsPathFromId
(
unescape
(
id
))
}
}
},
load
(
id
)
{
if
(
options
.
command
===
'
build
'
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录