Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
良好的行为成为习惯
uni-app
提交
928fbd2e
U
uni-app
项目概览
良好的行为成为习惯
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
928fbd2e
编写于
4月 11, 2022
作者:
S
songyu
提交者:
折腾笔记
4月 11, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 独立分包开关名修改
上级
0305a448
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
11 deletion
+11
-11
packages/uni-cli-shared/lib/cache.js
packages/uni-cli-shared/lib/cache.js
+1
-1
packages/uni-cli-shared/lib/pages.js
packages/uni-cli-shared/lib/pages.js
+1
-1
packages/uni-mp-weixin/lib/createIndependentPlugin.js
packages/uni-mp-weixin/lib/createIndependentPlugin.js
+2
-2
packages/uni-mp-weixin/lib/independent-plugins/inject-main-css-to-independent-plugin.js
...ependent-plugins/inject-main-css-to-independent-plugin.js
+1
-1
packages/uni-mp-weixin/lib/independent-plugins/optimize-components-position/index.js
...independent-plugins/optimize-components-position/index.js
+2
-2
packages/uni-mp-weixin/lib/uni.config.js
packages/uni-mp-weixin/lib/uni.config.js
+1
-1
packages/webpack-uni-mp-loader/lib/plugin/generate-json.js
packages/webpack-uni-mp-loader/lib/plugin/generate-json.js
+3
-3
未找到文件。
packages/uni-cli-shared/lib/cache.js
浏览文件 @
928fbd2e
...
...
@@ -106,7 +106,7 @@ function updateComponentJson (name, jsonObj, usingComponents = true, type = 'Com
function
updateUsingGlobalComponents
(
name
,
usingGlobalComponents
)
{
const
manifestConfig
=
process
.
UNI_MANIFEST
;
const
weixinConfig
=
manifestConfig
[
'
mp-weixin
'
];
const
independentSwitch
=
!!
weixinConfig
.
independent
Switch
;
const
independentSwitch
=
!!
weixinConfig
.
independent
;
if
(
!
independentSwitch
&&
supportGlobalUsingComponents
)
{
return
;
...
...
packages/uni-cli-shared/lib/pages.js
浏览文件 @
928fbd2e
...
...
@@ -211,7 +211,7 @@ function parseEntry (pagesJson) {
}
const
manifestConfig
=
process
.
UNI_MANIFEST
;
const
weixinConfig
=
manifestConfig
[
'
mp-weixin
'
]
||
{};
const
independentSwitch
=
!!
weixinConfig
.
independent
Switch
;
const
independentSwitch
=
!!
weixinConfig
.
independent
;
if
(
independentSwitch
)
{
Object
.
values
(
process
.
UNI_SUBPACKAGES
).
forEach
(({
root
,
independent
=
false
})
=>
{
if
(
root
&&
independent
)
{
...
...
packages/uni-mp-weixin/lib/createIndependentPlugin.js
浏览文件 @
928fbd2e
...
...
@@ -11,7 +11,7 @@ const AppInterceptorPlugin = require('./independent-plugins/app-interceptor-plug
module
.
exports
=
function
createIndependentPlugins
()
{
const
manifestConfig
=
process
.
UNI_MANIFEST
;
const
weixinConfig
=
manifestConfig
[
'
mp-weixin
'
];
const
independentSwitch
=
!!
weixinConfig
.
independent
Switch
;
const
independentSwitch
=
!!
weixinConfig
.
independent
;
if
(
!
independentSwitch
)
return
[];
// 支持构造微信小程序的独立分包
...
...
@@ -27,7 +27,7 @@ module.exports = function createIndependentPlugins () {
new
AppInterceptorPlugin
()
];
const
insertAppCssToIndependentSwitch
=
!!
weixinConfig
.
insertAppCssToIndependent
Switch
;
const
insertAppCssToIndependentSwitch
=
!!
weixinConfig
.
insertAppCssToIndependent
;
if
(
insertAppCssToIndependentSwitch
)
{
// 需要在 cacheSet 后面
independentPlugins
.
push
(
new
InjectMainCssToIndependentCssPlugin
());
// 目前只对页面注入了,组件未注入
...
...
packages/uni-mp-weixin/lib/independent-plugins/inject-main-css-to-independent-plugin.js
浏览文件 @
928fbd2e
...
...
@@ -35,7 +35,7 @@ function copyWeuiCssToIndependent (independentRoot) {
function
tryInsertWeuiCss
(
independentRoot
,
originalWxssStr
)
{
const
manifestConfig
=
process
.
UNI_MANIFEST
;
const
weixinConfig
=
manifestConfig
[
'
mp-weixin
'
]
||
{};
const
independentSwitch
=
!!
weixinConfig
.
independent
Switch
;
const
independentSwitch
=
!!
weixinConfig
.
independent
;
// 如果使用了weui,则需要注入weui样式
const
useExtendedWeUi
=
!!
(
weixinConfig
.
useExtendedLib
||
{}).
weui
;
...
...
packages/uni-mp-weixin/lib/independent-plugins/optimize-components-position/index.js
浏览文件 @
928fbd2e
...
...
@@ -13,8 +13,8 @@ class DependencyAnalyze {
init
(
emitFileMap
,
compilation
)
{
const
manifestConfig
=
process
.
UNI_MANIFEST
;
const
weixinConfig
=
manifestConfig
[
'
mp-weixin
'
]
||
{};
const
independentSwitch
=
!!
weixinConfig
.
independent
Switch
;
const
copyWxComponentsOnDemandSwitch
=
!!
weixinConfig
.
copyWxComponentsOnDemand
Switch
;
// 默认值false
const
independentSwitch
=
!!
weixinConfig
.
independent
;
const
copyWxComponentsOnDemandSwitch
=
!!
weixinConfig
.
copyWxComponentsOnDemand
;
// 默认值false
if
(
copyWxComponentsOnDemandSwitch
)
{
// 开启按需复制
new
CopyWxComponentOnDemand
(
emitFileMap
,
this
.
AnalyzeWxcomponentDependency
,
compilation
).
init
();
...
...
packages/uni-mp-weixin/lib/uni.config.js
浏览文件 @
928fbd2e
...
...
@@ -44,7 +44,7 @@ module.exports = {
const
manifestConfig
=
process
.
UNI_MANIFEST
;
const
weixinConfig
=
manifestConfig
[
'
mp-weixin
'
]
||
{};
const
copyWxComponentsOnDemandSwitch
=
!!
weixinConfig
.
copyWxComponentsOnDemand
Switch
;
// 默认值false
const
copyWxComponentsOnDemandSwitch
=
!!
weixinConfig
.
copyWxComponentsOnDemand
;
// 默认值false
if
(
!
copyWxComponentsOnDemandSwitch
)
{
const
wxcomponentsDir
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
COMPONENTS_DIR_NAME
);
...
...
packages/webpack-uni-mp-loader/lib/plugin/generate-json.js
浏览文件 @
928fbd2e
...
...
@@ -224,9 +224,9 @@ module.exports = function generateJson (compilation) {
for
(
const
[
name
,
jsonObj
]
of
emitFileMap
)
{
if
(
name
===
'
app.json
'
)
{
// 删除manifest.json携带的配置项
delete
jsonObj
.
insertAppCssToIndependent
Switch
;
delete
jsonObj
.
independent
Switch
;
delete
jsonObj
.
copyWxComponentsOnDemand
Switch
;
delete
jsonObj
.
insertAppCssToIndependent
;
delete
jsonObj
.
independent
;
delete
jsonObj
.
copyWxComponentsOnDemand
;
}
else
{
// 删除用于临时记录的属性
delete
jsonObj
.
usingGlobalComponents
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录