Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
菜鸟程序猿_c
uni-app
提交
75e40632
U
uni-app
项目概览
菜鸟程序猿_c
/
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,发现更多精彩内容 >>
提交
75e40632
编写于
7月 27, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
6e280cc4
39b00502
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
244 addition
and
153 deletion
+244
-153
packages/uni-cli-shared/lib/preprocess.js
packages/uni-cli-shared/lib/preprocess.js
+8
-1
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+208
-143
packages/vue-cli-plugin-uni/index.js
packages/vue-cli-plugin-uni/index.js
+1
-1
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+14
-4
packages/vue-cli-plugin-uni/lib/mp/index.js
packages/vue-cli-plugin-uni/lib/mp/index.js
+5
-3
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
+1
-1
packages/webpack-uni-mp-loader/lib/main-new.js
packages/webpack-uni-mp-loader/lib/main-new.js
+4
-0
src/platforms/app-plus/service/publish-handler.js
src/platforms/app-plus/service/publish-handler.js
+3
-0
未找到文件。
packages/uni-cli-shared/lib/preprocess.js
浏览文件 @
75e40632
...
...
@@ -27,7 +27,14 @@ module.exports = function initPreprocess (name, platforms, userDefines = {}) {
defaultContext
[
normalize
(
name
)]
=
false
})
defaultContext
.
VUE2
=
true
if
(
process
.
env
.
UNI_USING_VUE3
)
{
defaultContext
.
VUE3
=
true
}
else
{
defaultContext
.
VUE2
=
true
}
// nvue 只支持vue2
nvueContext
.
VUE2
=
true
nvueContext
.
VUE3
=
false
vueContext
[
normalize
(
name
)]
=
true
...
...
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
75e40632
此差异已折叠。
点击以展开。
packages/vue-cli-plugin-uni/index.js
浏览文件 @
75e40632
...
...
@@ -87,5 +87,5 @@ const args = require('minimist')(process.argv.slice(2))
module
.
exports
.
defaultModes
=
{
'
uni-serve
'
:
args
.
mode
||
'
development
'
,
'
uni-build
'
:
args
.
mode
||
process
.
env
.
NODE_ENV
'
uni-build
'
:
args
.
mode
||
process
.
env
.
NODE_ENV
}
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
75e40632
...
...
@@ -16,11 +16,20 @@ if (process.env.UNI_INPUT_DIR && process.env.UNI_INPUT_DIR.indexOf('./') === 0)
process
.
env
.
UNI_INPUT_DIR
=
path
.
resolve
(
process
.
cwd
(),
process
.
env
.
UNI_INPUT_DIR
)
}
process
.
env
.
UNI_INPUT_DIR
=
process
.
env
.
UNI_INPUT_DIR
||
path
.
resolve
(
process
.
cwd
(),
defaultInputDir
)
const
manifestJsonObj
=
require
(
'
@dcloudio/uni-cli-shared/lib/manifest
'
).
getManifestJson
()
// 小程序 vue3 标记
if
(
process
.
env
.
UNI_PLATFORM
.
indexOf
(
'
mp-
'
)
===
0
)
{
if
(
manifestJsonObj
.
vueVersion
===
'
3
'
||
manifestJsonObj
.
vueVersion
===
3
)
{
process
.
env
.
UNI_USING_VUE3
=
true
process
.
env
.
UNI_USING_VUE3_OPTIONS_API
=
true
}
}
// 初始化全局插件对象
global
.
uniPlugin
=
require
(
'
@dcloudio/uni-cli-shared/lib/plugin
'
).
init
()
global
.
uniPlugin
=
require
(
'
@dcloudio/uni-cli-shared/lib/plugin
'
).
init
()
const
manifestJsonObj
=
require
(
'
@dcloudio/uni-cli-shared/lib/manifest
'
).
getManifestJson
()
const
platformOptions
=
manifestJsonObj
[
process
.
env
.
UNI_SUB_PLATFORM
||
process
.
env
.
UNI_PLATFORM
]
||
{}
// 插件校验环境
global
.
uniPlugin
.
validate
.
forEach
(
validate
=>
{
...
...
@@ -263,7 +272,8 @@ if (platformOptions.usingComponents === true) {
// 兼容历史配置 betterScopedSlots
const
modes
=
[
'
legacy
'
,
'
auto
'
,
'
augmented
'
]
const
scopedSlotsCompiler
=
!
platformOptions
.
scopedSlotsCompiler
&&
platformOptions
.
betterScopedSlots
?
modes
[
2
]
:
platformOptions
.
scopedSlotsCompiler
const
scopedSlotsCompiler
=
!
platformOptions
.
scopedSlotsCompiler
&&
platformOptions
.
betterScopedSlots
?
modes
[
2
]
:
platformOptions
.
scopedSlotsCompiler
process
.
env
.
SCOPED_SLOTS_COMPILER
=
modes
.
includes
(
scopedSlotsCompiler
)
?
scopedSlotsCompiler
:
modes
[
1
]
// 快手小程序抽象组件编译报错,如未指定 legacy 固定为 augmented 模式
if
(
process
.
env
.
UNI_PLATFORM
===
'
mp-kuaishou
'
&&
process
.
env
.
SCOPED_SLOTS_COMPILER
!==
modes
[
0
])
{
...
...
@@ -465,4 +475,4 @@ runByHBuilderX && console.log('正在编译中...')
module
.
exports
=
{
manifestPlatformOptions
:
platformOptions
}
}
packages/vue-cli-plugin-uni/lib/mp/index.js
浏览文件 @
75e40632
...
...
@@ -128,7 +128,8 @@ class PreprocessAssetsPlugin {
function
initSubpackageConfig
(
webpackConfig
,
vueOptions
)
{
if
(
process
.
env
.
UNI_OUTPUT_DEFAULT_DIR
===
process
.
env
.
UNI_OUTPUT_DIR
)
{
// 未自定义output
process
.
env
.
UNI_OUTPUT_DIR
=
path
.
resolve
(
process
.
env
.
UNI_OUTPUT_DIR
,
(
process
.
env
.
UNI_SUBPACKGE
||
process
.
env
.
UNI_MP_PLUGIN
))
process
.
env
.
UNI_OUTPUT_DIR
=
path
.
resolve
(
process
.
env
.
UNI_OUTPUT_DIR
,
(
process
.
env
.
UNI_SUBPACKGE
||
process
.
env
.
UNI_MP_PLUGIN
))
}
vueOptions
.
outputDir
=
process
.
env
.
UNI_OUTPUT_DIR
webpackConfig
.
output
.
path
(
process
.
env
.
UNI_OUTPUT_DIR
)
...
...
@@ -175,7 +176,8 @@ module.exports = {
const
UNI_MP_PLUGIN_MAIN
=
process
.
env
.
UNI_MP_PLUGIN_MAIN
if
(
UNI_MP_PLUGIN_MAIN
)
{
process
.
UNI_ENTRY
[
UNI_MP_PLUGIN_MAIN
.
split
(
'
.
'
)[
0
]]
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
UNI_MP_PLUGIN_MAIN
)
process
.
UNI_ENTRY
[
UNI_MP_PLUGIN_MAIN
.
split
(
'
.
'
)[
0
]]
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
UNI_MP_PLUGIN_MAIN
)
}
}
...
...
@@ -295,4 +297,4 @@ module.exports = {
webpackConfig
.
plugins
.
delete
(
'
preload
'
)
webpackConfig
.
plugins
.
delete
(
'
prefetch
'
)
}
}
}
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
浏览文件 @
75e40632
此差异已折叠。
点击以展开。
packages/webpack-uni-mp-loader/lib/main-new.js
浏览文件 @
75e40632
...
...
@@ -77,6 +77,10 @@ createPage(Page)
type
:
jsPreprocessOptions
.
type
})
if
(
process
.
env
.
UNI_USING_VUE3
)
{
content
=
content
+
'
;createApp().app.mount(
\'
#app
\'
);
'
}
const
resourcePath
=
'
app
'
const
{
...
...
src/platforms/app-plus/service/publish-handler.js
浏览文件 @
75e40632
...
...
@@ -8,6 +8,9 @@ export function publishHandler (eventType, args, pageIds) {
}
const
evalJSCode
=
`typeof UniViewJSBridge !== 'undefined' && UniViewJSBridge.subscribeHandler("
${
eventType
}
",
${
args
}
,__PAGE_ID__)`
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`UNIAPP[publishHandler]:[
${
+
new
Date
()}
]`
,
'
length
'
,
evalJSCode
.
length
)
}
pageIds
.
forEach
(
id
=>
{
const
webview
=
plus
.
webview
.
getWebviewById
(
String
(
id
))
webview
&&
webview
.
evalJS
(
evalJSCode
.
replace
(
'
__PAGE_ID__
'
,
id
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录