Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Velpro187
uni-app
提交
8395a83b
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,发现更多精彩内容 >>
提交
8395a83b
编写于
10月 22, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(mp): custom chunk
上级
6b0586dc
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
382 addition
and
219 deletion
+382
-219
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+15
-6
packages/uni-cli-shared/src/json/mp/jsonFile.ts
packages/uni-cli-shared/src/json/mp/jsonFile.ts
+8
-0
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+315
-207
packages/uni-mp-compiler/src/compile.ts
packages/uni-mp-compiler/src/compile.ts
+1
-1
packages/uni-mp-vite/src/plugin/build.ts
packages/uni-mp-vite/src/plugin/build.ts
+43
-5
未找到文件。
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
8395a83b
...
...
@@ -1769,21 +1769,30 @@ var serviceContext = (function (vue) {
});
const initI18nSetClipboardDataMsgsOnce = /*#__PURE__*/ once(() => {
const name = 'uni.setClipboardData.';
const keys = ['success'];
const keys = ['success'
, 'fail'
];
{
useI18n().add(LOCALE_EN, normalizeMessages(name, keys, ['Content copied']), false);
useI18n().add(LOCALE_EN, normalizeMessages(name, keys, [
'Content copied',
'Copy failed, please copy manually',
]), false);
}
{
useI18n().add(LOCALE_ES, normalizeMessages(name, keys, ['Contenido copiado']), false);
useI18n().add(LOCALE_ES, normalizeMessages(name, keys, [
'Contenido copiado',
'Error al copiar, copie manualmente',
]), false);
}
{
useI18n().add(LOCALE_FR, normalizeMessages(name, keys, ['Contenu copié']), false);
useI18n().add(LOCALE_FR, normalizeMessages(name, keys, [
'Contenu copié',
'Échec de la copie, copiez manuellement',
]), false);
}
{
useI18n().add(LOCALE_ZH_HANS, normalizeMessages(name, keys, ['内容已复制']), false);
useI18n().add(LOCALE_ZH_HANS, normalizeMessages(name, keys, ['内容已复制'
, '复制失败,请手动复制'
]), false);
}
{
useI18n().add(LOCALE_ZH_HANT, normalizeMessages(name, keys, ['內容已復制']), false);
useI18n().add(LOCALE_ZH_HANT, normalizeMessages(name, keys, ['內容已復制'
, '復制失敗,請手動復製'
]), false);
}
});
const initI18nScanCodeMsgsOnce = /*#__PURE__*/ once(() => {
...
...
packages/uni-cli-shared/src/json/mp/jsonFile.ts
浏览文件 @
8395a83b
...
...
@@ -8,6 +8,14 @@ const jsonPagesCache = new Map<string, PageWindowOptions>()
const
jsonComponentsCache
=
new
Map
<
string
,
ComponentJson
>
()
const
jsonUsingComponentsCache
=
new
Map
<
string
,
UsingComponents
>
()
export
function
hasJsonFile
(
filename
:
string
)
{
return
(
filename
===
'
app
'
||
jsonPagesCache
.
has
(
filename
)
||
jsonComponentsCache
.
has
(
filename
)
)
}
export
function
normalizeJsonFilename
(
filename
:
string
)
{
return
normalizeNodeModules
(
filename
)
}
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
8395a83b
此差异已折叠。
点击以展开。
packages/uni-mp-compiler/src/compile.ts
浏览文件 @
8395a83b
...
...
@@ -51,7 +51,7 @@ export function baseCompile(template: string, options: CompilerOptions = {}) {
options
.
hashId
=
genHashId
(
options
)
if
(
options
.
filename
)
{
if
(
options
.
filters
&&
options
.
miniProgram
?.
filter
)
{
if
(
!
options
.
filters
&&
options
.
miniProgram
?.
filter
)
{
options
.
filters
=
parseFilters
(
options
.
miniProgram
.
filter
.
lang
,
options
.
filename
...
...
packages/uni-mp-vite/src/plugin/build.ts
浏览文件 @
8395a83b
import
fs
from
'
fs
'
import
path
from
'
path
'
import
debug
from
'
debug
'
import
{
UserConfig
}
from
'
vite
'
import
{
emptyDir
,
EXTNAME_JS_RE
,
isCSSRequest
,
normalizePath
,
hasJsonFile
,
removeExt
,
resolveMainPathOnce
,
}
from
'
@dcloudio/uni-cli-shared
'
import
{
GetManualChunk
,
GetModuleInfo
}
from
'
rollup
'
...
...
@@ -16,6 +20,8 @@ import {
parseVirtualPagePath
,
}
from
'
../plugins/entry
'
const
debugChunk
=
debug
(
'
vite:uni:chunk
'
)
export
function
buildOptions
():
UserConfig
[
'
build
'
]
{
const
inputDir
=
process
.
env
.
UNI_INPUT_DIR
const
outputDir
=
process
.
env
.
UNI_OUTPUT_DIR
...
...
@@ -25,6 +31,7 @@ export function buildOptions(): UserConfig['build'] {
}
return
{
// sourcemap: 'inline', // TODO
target
:
[
'
chrome53
'
],
emptyOutDir
:
false
,
// 不清空输出目录,否则会影响自定义的一些文件输出,比如wxml
assetsInlineLimit
:
0
,
// TODO
lib
:
{
...
...
@@ -62,16 +69,47 @@ export function buildOptions(): UserConfig['build'] {
}
}
function
isVueJs
(
id
:
string
)
{
return
(
id
.
includes
(
'
plugin-vue:export-helper
'
)
||
(
id
.
includes
(
'
/@vue/
'
)
&&
id
.
endsWith
(
'
.js
'
))
)
}
function
isDCloudJs
(
id
:
string
)
{
return
id
.
includes
(
'
/@dcloudio/
'
)
&&
id
.
endsWith
(
'
.js
'
)
}
const
chunkFileNameBlackList
=
[
'
main
'
,
'
pages.json
'
,
'
manifest.json
'
]
function
createMoveToVendorChunkFn
():
GetManualChunk
{
const
cache
=
new
Map
<
string
,
boolean
>
()
const
inputDir
=
normalizePath
(
process
.
env
.
UNI_INPUT_DIR
)
return
(
id
,
{
getModuleInfo
})
=>
{
id
=
normalizePath
(
id
)
if
(
(
id
.
includes
(
'
node_modules
'
)
||
id
.
includes
(
'
plugin-vue:export-helper
'
))
&&
!
isCSSRequest
(
id
)
&&
staticImportedByEntry
(
id
,
getModuleInfo
,
cache
)
isVueJs
(
id
)
||
isDCloudJs
(
id
)
||
(
id
.
includes
(
'
node_modules
'
)
&&
!
isCSSRequest
(
id
)
&&
staticImportedByEntry
(
id
,
getModuleInfo
,
cache
))
)
{
return
'
vendor
'
debugChunk
(
'
common/vendor
'
,
id
)
return
'
common/vendor
'
}
const
filename
=
id
.
split
(
'
?
'
)[
0
]
// 处理项目内的js,ts文件
if
(
EXTNAME_JS_RE
.
test
(
filename
)
&&
filename
.
startsWith
(
inputDir
))
{
const
chunkFileName
=
removeExt
(
normalizePath
(
path
.
relative
(
inputDir
,
filename
))
)
if
(
!
chunkFileNameBlackList
.
includes
(
chunkFileName
)
&&
!
hasJsonFile
(
chunkFileName
)
// 无同名的page,component
)
{
debugChunk
(
chunkFileName
,
id
)
return
chunkFileName
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录