Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
9240955a
U
uni-app
项目概览
DCloud
/
uni-app
3 个月 前同步成功
通知
725
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,发现更多精彩内容 >>
提交
9240955a
编写于
12月 06, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(deps): bump vite from 2.6.14 to 2.7.0-beta.11
上级
96faab95
变更
15
展开全部
显示空白变更内容
内联
并排
Showing
15 changed file
with
1004 addition
and
891 deletion
+1004
-891
package.json
package.json
+1
-1
packages/playground/ssr/package.json
packages/playground/ssr/package.json
+1
-1
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+45
-1
packages/uni-app-vite/package.json
packages/uni-app-vite/package.json
+1
-1
packages/uni-cli-nvue/package.json
packages/uni-cli-nvue/package.json
+1
-1
packages/uni-cli-shared/package.json
packages/uni-cli-shared/package.json
+1
-1
packages/uni-cli-shared/src/vite/plugins/jsonJs.ts
packages/uni-cli-shared/src/vite/plugins/jsonJs.ts
+2
-2
packages/uni-h5-vite/src/plugins/mainJs.ts
packages/uni-h5-vite/src/plugins/mainJs.ts
+8
-6
packages/uni-h5-vite/src/plugins/pagesJson.ts
packages/uni-h5-vite/src/plugins/pagesJson.ts
+3
-1
packages/uni-h5-vite/src/plugins/resolveId.ts
packages/uni-h5-vite/src/plugins/resolveId.ts
+3
-7
packages/uni-h5-vite/src/plugins/ssr.ts
packages/uni-h5-vite/src/plugins/ssr.ts
+3
-7
packages/uni-h5-vite/src/utils/ssr.ts
packages/uni-h5-vite/src/utils/ssr.ts
+13
-16
packages/uni-mp-vite/src/plugin/index.ts
packages/uni-mp-vite/src/plugin/index.ts
+1
-0
packages/vite-plugin-uni/package.json
packages/vite-plugin-uni/package.json
+1
-1
pnpm-lock.yaml
pnpm-lock.yaml
+920
-845
未找到文件。
package.json
浏览文件 @
9240955a
...
...
@@ -81,7 +81,7 @@
"
semver
"
:
"
^7.3.5
"
,
"
ts-jest
"
:
"
^27.0.3
"
,
"
typescript
"
:
"
^4.4.3
"
,
"
vite
"
:
"
^2.
6.14
"
,
"
vite
"
:
"
^2.
7.0-beta.11
"
,
"
vue
"
:
"
3.2.23
"
,
"
vue-router
"
:
"
^4.0.12
"
,
"
yorkie
"
:
"
^2.0.0
"
...
...
packages/playground/ssr/package.json
浏览文件 @
9240955a
...
...
@@ -21,6 +21,6 @@
"compression"
:
"^1.7.4"
,
"cypress"
:
"^7.3.0"
,
"serve-static"
:
"^1.14.1"
,
"vite"
:
"^2.
6.14
"
"vite"
:
"^2.
7.0-beta.11
"
}
}
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
9240955a
...
...
@@ -1795,6 +1795,50 @@ var serviceContext = (function (vue) {
useI18n().add(LOCALE_ZH_HANT, normalizeMessages(name, keys, ['取消', '從相冊選擇', '拍攝']), false);
}
});
const initI18nPreviewImageMsgsOnce = /*#__PURE__*/ once(() => {
const name = 'uni.previewImage.';
const keys = ['cancel', 'button.save', 'save.success', 'save.fail'];
{
useI18n().add(LOCALE_EN, normalizeMessages(name, keys, [
'Cancel',
'Save Image',
'Saved successfully',
'Save failed',
]), false);
}
{
useI18n().add(LOCALE_ES, normalizeMessages(name, keys, [
'Cancelar',
'Guardar imagen',
'Guardado exitosamente',
'Error al guardar',
]), false);
}
{
useI18n().add(LOCALE_FR, normalizeMessages(name, keys, [
'Annuler',
'Guardar imagen',
'Enregistré avec succès',
'Échec de la sauvegarde',
]), false);
}
{
useI18n().add(LOCALE_ZH_HANS, normalizeMessages(name, keys, [
'取消',
'保存图像',
'保存图像到相册成功',
'保存图像到相册失败',
]), false);
}
{
useI18n().add(LOCALE_ZH_HANT, normalizeMessages(name, keys, [
'取消',
'保存圖像',
'保存圖像到相冊成功',
'保存圖像到相冊失敗',
]), false);
}
});
const initI18nSetClipboardDataMsgsOnce = /*#__PURE__*/ once(() => {
const name = 'uni.setClipboardData.';
const keys = ['success', 'fail'];
...
...
@@ -14269,7 +14313,7 @@ var serviceContext = (function (vue) {
}, GetVideoInfoProtocol, GetVideoInfoOptions);
const previewImage = defineAsyncApi(API_PREVIEW_IMAGE, ({ current = 0, indicator = 'number', loop = false, urls, longPressActions }, { resolve, reject }) => {
initI18n
Choose
ImageMsgsOnce();
initI18n
Preview
ImageMsgsOnce();
const { t } = useI18n();
urls = urls.map((url) => getRealPath(url));
const index = Number(current);
...
...
packages/uni-app-vite/package.json
浏览文件 @
9240955a
...
...
@@ -27,7 +27,7 @@
"@vitejs/plugin-vue"
:
"^1.10.1"
,
"debug"
:
"^4.3.2"
,
"fs-extra"
:
"^10.0.0"
,
"rollup"
:
"^2.5
7
.0"
"rollup"
:
"^2.5
9
.0"
},
"devDependencies"
:
{
"@types/debug"
:
"^4.1.7"
,
...
...
packages/uni-cli-nvue/package.json
浏览文件 @
9240955a
...
...
@@ -40,7 +40,7 @@
"lru-cache"
:
"^4.1.2"
,
"merge-source-map"
:
"^1.1.0"
,
"module-alias"
:
"^2.2.2"
,
"postcss"
:
"^8.3.
8
"
,
"postcss"
:
"^8.3.
11
"
,
"postcss-comment"
:
"^2.0.0"
,
"postcss-import"
:
"^14.0.2"
,
"postcss-loader"
:
"^6.1.1"
,
...
...
packages/uni-cli-shared/package.json
浏览文件 @
9240955a
...
...
@@ -33,7 +33,7 @@
"compare-versions"
:
"^3.6.0"
,
"debug"
:
"^4.3.2"
,
"es-module-lexer"
:
"^0.9.3"
,
"esbuild"
:
"^0.13.2"
,
"esbuild"
:
"^0.13.
1
2"
,
"estree-walker"
:
"^2.0.2"
,
"fast-glob"
:
"^3.2.7"
,
"fs-extra"
:
"^10.0.0"
,
...
...
packages/uni-cli-shared/src/vite/plugins/jsonJs.ts
浏览文件 @
9240955a
...
...
@@ -27,9 +27,9 @@ function createDefineJsonJsPlugin(name: 'pages.json' | 'manifest.json') {
let
jsonPath
=
''
plugin
.
resolveId
=
function
(
id
,
importer
,
options
,
ssr
)
{
plugin
.
resolveId
=
function
(
id
,
importer
,
options
)
{
const
res
=
origResolveId
&&
origResolveId
.
call
(
this
,
id
,
importer
,
options
,
ssr
)
origResolveId
&&
origResolveId
.
call
(
this
,
id
,
importer
,
options
)
if
(
res
)
{
return
res
}
...
...
packages/uni-h5-vite/src/plugins/mainJs.ts
浏览文件 @
9240955a
import
path
from
'
path
'
import
{
defineUniMainJsPlugin
,
normalizePath
}
from
'
@dcloudio/uni-cli-shared
'
import
{
isSsr
,
isSsrManifest
}
from
'
../utils
'
import
{
isS
SR
,
isS
sr
,
isSsrManifest
}
from
'
../utils
'
export
function
uniMainJsPlugin
()
{
return
defineUniMainJsPlugin
((
opts
)
=>
{
let
pagesJsonJsPath
=
''
let
is
SSR
=
false
let
run
SSR
=
false
return
{
name
:
'
vite:uni-h5-main-js
'
,
enforce
:
'
pre
'
,
...
...
@@ -13,17 +13,19 @@ export function uniMainJsPlugin() {
pagesJsonJsPath
=
normalizePath
(
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
pages.json.js
'
)
)
is
SSR
=
run
SSR
=
isSsr
(
config
.
command
,
config
)
||
isSsrManifest
(
config
.
command
,
config
)
},
transform
(
code
,
id
,
ssr
)
{
transform
(
code
,
id
,
options
)
{
if
(
opts
.
filter
(
id
))
{
if
(
!
is
SSR
)
{
if
(
!
run
SSR
)
{
code
=
code
.
includes
(
'
createSSRApp
'
)
?
createApp
(
code
)
:
createLegacyApp
(
code
)
}
else
{
code
=
ssr
?
createSSRServerApp
(
code
)
:
createSSRClientApp
(
code
)
code
=
isSSR
(
options
)
?
createSSRServerApp
(
code
)
:
createSSRClientApp
(
code
)
}
code
=
`import '
${
pagesJsonJsPath
}
';
${
code
}
`
return
{
...
...
packages/uni-h5-vite/src/plugins/pagesJson.ts
浏览文件 @
9240955a
...
...
@@ -14,15 +14,17 @@ import {
isEnableTreeShaking
,
parseManifestJsonOnce
,
}
from
'
@dcloudio/uni-cli-shared
'
import
{
isSSR
}
from
'
../utils
'
export
function
uniPagesJsonPlugin
():
Plugin
{
return
defineUniPagesJsonPlugin
((
opts
)
=>
{
return
{
name
:
'
vite:uni-h5-pages-json
'
,
enforce
:
'
pre
'
,
transform
(
code
,
id
,
ssr
)
{
transform
(
code
,
id
,
opt
)
{
if
(
opts
.
filter
(
id
))
{
const
{
resolvedConfig
}
=
opts
const
ssr
=
isSSR
(
opt
)
return
{
code
:
registerGlobalCode
(
resolvedConfig
,
ssr
)
+
...
...
packages/uni-h5-vite/src/plugins/resolveId.ts
浏览文件 @
9240955a
...
...
@@ -2,7 +2,7 @@ import path from 'path'
import
debug
from
'
debug
'
import
type
{
Plugin
}
from
'
vite
'
import
{
resolveBuiltIn
,
parseCompatConfigOnce
}
from
'
@dcloudio/uni-cli-shared
'
import
{
resolveBuiltIn
}
from
'
@dcloudio/uni-cli-shared
'
import
{
ownerModuleName
}
from
'
../utils
'
const
debugResolve
=
debug
(
'
vite:uni:resolve
'
)
...
...
@@ -12,16 +12,12 @@ export function uniResolveIdPlugin(): Plugin {
return
{
name
:
'
vite:uni-h5-resolve-id
'
,
enforce
:
'
pre
'
,
configResolved
()
{
const
{
MODE
}
=
parseCompatConfigOnce
(
process
.
env
.
UNI_INPUT_DIR
)
config
()
{
resolveCache
[
ownerModuleName
]
=
resolveBuiltIn
(
path
.
join
(
ownerModuleName
,
'
dist/uni-h5.es.js
'
)
)
resolveCache
[
'
@dcloudio/uni-h5-vue
'
]
=
resolveBuiltIn
(
path
.
join
(
'
@dcloudio/uni-h5-vue
'
,
`dist/vue.runtime.
${
MODE
===
2
?
'
compat.
'
:
''
}
esm.js`
)
path
.
join
(
'
@dcloudio/uni-h5-vue
'
,
`dist/vue.runtime.esm.js`
)
)
},
resolveId
(
id
)
{
...
...
packages/uni-h5-vite/src/plugins/ssr.ts
浏览文件 @
9240955a
...
...
@@ -3,10 +3,7 @@ import type { Plugin, ResolvedConfig } from 'vite'
import
{
OutputChunk
}
from
'
rollup
'
import
{
parseCompatConfigOnce
,
parseRpx2UnitOnce
,
}
from
'
@dcloudio/uni-cli-shared
'
import
{
parseRpx2UnitOnce
}
from
'
@dcloudio/uni-cli-shared
'
import
{
isSsr
,
...
...
@@ -31,10 +28,9 @@ export function uniSSRPlugin(): Plugin {
resolvedConfig
=
config
entryServerJs
=
path
.
join
(
process
.
env
.
UNI_INPUT_DIR
,
ENTRY_SERVER_JS
)
if
(
isSsr
(
resolvedConfig
.
command
,
resolvedConfig
))
{
const
{
MODE
}
=
parseCompatConfigOnce
(
process
.
env
.
UNI_INPUT_DIR
)
initSsrDefine
(
resolvedConfig
)
rewriteSsrVue
(
MODE
)
rewriteSsrResolve
(
MODE
)
rewriteSsrVue
()
rewriteSsrResolve
()
rewriteSsrNativeTag
()
rewriteSsrRenderStyle
(
process
.
env
.
UNI_INPUT_DIR
)
}
...
...
packages/uni-h5-vite/src/utils/ssr.ts
浏览文件 @
9240955a
...
...
@@ -17,6 +17,10 @@ import resolve from 'resolve'
import
{
resolveComponentType
}
from
'
@vue/compiler-dom
'
import
{
transformPageHead
}
from
'
../plugin/transforms/transformPageHead
'
// Temporal handling for 2.7 breaking change
export
const
isSSR
=
(
opt
:
{
ssr
?:
boolean
}
|
boolean
|
undefined
)
=>
opt
===
undefined
?
false
:
typeof
opt
===
'
boolean
'
?
opt
:
opt
?.
ssr
===
true
export
function
isSsr
(
command
:
ConfigEnv
[
'
command
'
],
config
:
UserConfig
|
ResolvedConfig
...
...
@@ -86,17 +90,12 @@ export function generateSsrEntryServerCode() {
)
}
export
function
rewriteSsrVue
(
mode
?:
2
|
3
)
{
export
function
rewriteSsrVue
()
{
// 解决 @vue/server-renderer 中引入 vue 的映射
let
vuePath
:
string
if
(
mode
===
2
)
{
vuePath
=
resolveBuiltIn
(
'
@dcloudio/uni-h5-vue/dist/vue.runtime.compat.cjs.js
'
require
(
'
module-alias
'
).
addAlias
(
'
vue
'
,
resolveBuiltIn
(
'
@dcloudio/uni-h5-vue/dist/vue.runtime.cjs.js
'
)
)
}
else
{
vuePath
=
resolveBuiltIn
(
'
@dcloudio/uni-h5-vue/dist/vue.runtime.cjs.js
'
)
}
require
(
'
module-alias
'
).
addAlias
(
'
vue
'
,
vuePath
)
}
function
initResolveSyncOpts
(
opts
?:
resolve
.
SyncOpts
)
{
...
...
@@ -115,7 +114,7 @@ function initResolveSyncOpts(opts?: resolve.SyncOpts) {
return
opts
}
export
function
rewriteSsrResolve
(
mode
?:
2
|
3
)
{
export
function
rewriteSsrResolve
()
{
// 解决 ssr 时 __vite_ssr_import__("vue") 的映射
const
resolve
=
require
(
require
.
resolve
(
'
resolve
'
,
{
paths
:
[
...
...
@@ -125,11 +124,9 @@ export function rewriteSsrResolve(mode?: 2 | 3) {
const
oldSync
=
resolve
.
sync
resolve
.
sync
=
(
id
:
string
,
opts
?:
resolve
.
SyncOpts
)
=>
{
if
(
id
===
'
vue
'
)
{
return
resolveBuiltIn
(
`@dcloudio/uni-h5-vue/dist/vue.runtime.
${
mode
===
2
?
'
compat.
'
:
''
}
cjs.js`
)
return
resolveBuiltIn
(
`@dcloudio/uni-h5-vue/dist/vue.runtime.cjs.js`
)
}
else
if
(
id
===
'
vue/package.json
'
)
{
return
resolveBuiltIn
(
`@dcloudio/uni-h5-vue/package.json`
)
}
return
oldSync
(
id
,
initResolveSyncOpts
(
opts
))
}
...
...
packages/uni-mp-vite/src/plugin/index.ts
浏览文件 @
9240955a
...
...
@@ -123,6 +123,7 @@ export function uniMiniProgramPlugin(
'
vue-i18n
'
:
path
.
resolve
(
__dirname
,
'
../../lib/vue-i18n
'
),
...
alias
,
},
preserveSymlinks
:
true
,
},
build
:
buildOptions
(),
}
...
...
packages/vite-plugin-uni/package.json
浏览文件 @
9240955a
...
...
@@ -53,7 +53,7 @@
"chokidar"
:
"^3.5.2"
},
"peerDependencies"
:
{
"vite"
:
"^2.
6.14
"
"vite"
:
"^2.
7.0-beta.11
"
},
"uni-app"
:
{
"compilerVersion"
:
"3.3.0"
...
...
pnpm-lock.yaml
浏览文件 @
9240955a
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录