Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
05a38735
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,发现更多精彩内容 >>
提交
05a38735
编写于
1月 16, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/dcloudio/uni-app
into alpha
上级
4035008f
e37fb47a
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
53 addition
and
13 deletion
+53
-13
packages/uni-cli-shared/lib/package.js
packages/uni-cli-shared/lib/package.js
+2
-2
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
+7
-2
packages/vue-cli-plugin-uni/commands/build.js
packages/vue-cli-plugin-uni/commands/build.js
+5
-2
packages/vue-cli-plugin-uni/lib/app-plus/index.js
packages/vue-cli-plugin-uni/lib/app-plus/index.js
+3
-1
packages/vue-cli-plugin-uni/lib/chain-webpack.js
packages/vue-cli-plugin-uni/lib/chain-webpack.js
+2
-1
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+24
-0
packages/vue-cli-plugin-uni/lib/h5/index.js
packages/vue-cli-plugin-uni/lib/h5/index.js
+4
-2
packages/vue-cli-plugin-uni/lib/mp.js
packages/vue-cli-plugin-uni/lib/mp.js
+3
-1
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
+1
-0
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js
...bpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js
+2
-2
未找到文件。
packages/uni-cli-shared/lib/package.js
浏览文件 @
05a38735
...
...
@@ -30,7 +30,7 @@ module.exports = {
}
if
(
PLATFORMS
.
indexOf
(
scriptOptions
.
env
.
UNI_PLATFORM
)
===
-
1
)
{
console
.
error
(
`UNI_PLATFORM 支持
一
下平台
${
JSON
.
stringify
(
PLATFORMS
)}
`
)
console
.
error
(
`UNI_PLATFORM 支持
以
下平台
${
JSON
.
stringify
(
PLATFORMS
)}
`
)
process
.
exit
(
0
)
}
...
...
@@ -41,4 +41,4 @@ module.exports = {
return
scriptOptions
}
}
}
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
浏览文件 @
05a38735
...
...
@@ -36,7 +36,11 @@ const uniPath = process.env.UNI_USING_V8
?
'
../packages/uni-app-plus-nvue-v8/dist/index.js
'
:
'
../packages/uni-app-plus-nvue/dist/index.js
'
const
provide
=
{}
const
uniCloudPath
=
require
.
resolve
(
'
@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
'
)
const
provide
=
{
'
uniCloud
'
:
[
uniCloudPath
,
'
default
'
]
}
if
(
process
.
env
.
UNI_USING_V3
||
process
.
env
.
UNI_USING_NATIVE
)
{
provide
[
'
uni.getCurrentSubNVue
'
]
=
[
path
.
resolve
(
__dirname
,
...
...
@@ -68,7 +72,8 @@ const plugins = [
new
webpack
.
DefinePlugin
({
'
process.env
'
:
{
'
NODE_ENV
'
:
JSON
.
stringify
(
process
.
env
.
NODE_ENV
),
'
VUE_APP_PLATFORM
'
:
JSON
.
stringify
(
process
.
env
.
UNI_PLATFORM
)
'
VUE_APP_PLATFORM
'
:
JSON
.
stringify
(
process
.
env
.
UNI_PLATFORM
),
'
UNI_CLOUD_PROVIDER
'
:
process
.
env
.
UNI_CLOUD_PROVIDER
}
}),
new
webpack
.
BannerPlugin
({
...
...
packages/vue-cli-plugin-uni/commands/build.js
浏览文件 @
05a38735
...
...
@@ -64,6 +64,9 @@ function getWebpackConfig (api, args, options) {
})
}
else
{
modifyConfig
(
webpackConfig
,
config
=>
{
if
(
!
config
.
optimization
)
{
config
.
optimization
=
{}
}
config
.
optimization
.
namedModules
=
false
})
}
...
...
@@ -77,11 +80,11 @@ function getWebpackConfigs (api, args, options) {
const
pluginOptions
=
(
options
.
pluginOptions
||
(
options
.
pluginOptions
=
{}))
pluginOptions
[
'
uni-app-plus
'
]
=
{
service
:
true
}
}
options
.
publicPath
=
'
/
'
const
serviceWebpackConfig
=
getWebpackConfig
(
api
,
args
,
options
)
delete
pluginOptions
[
'
uni-app-plus
'
][
'
service
'
]
pluginOptions
[
'
uni-app-plus
'
][
'
view
'
]
=
true
pluginOptions
[
'
uni-app-plus
'
][
'
view
'
]
=
true
options
.
publicPath
=
'
./
'
const
viewWebpackConfig
=
getWebpackConfig
(
api
,
args
,
options
)
return
[
serviceWebpackConfig
,
viewWebpackConfig
]
...
...
packages/vue-cli-plugin-uni/lib/app-plus/index.js
浏览文件 @
05a38735
...
...
@@ -24,6 +24,7 @@ const {
const
runtimePath
=
'
@dcloudio/uni-mp-weixin/dist/mp.js
'
const
wxsPath
=
'
@dcloudio/uni-mp-weixin/dist/wxs.js
'
const
uniCloudPath
=
path
.
resolve
(
__dirname
,
'
../../packages/uni-cloud/dist/index.js
'
)
function
getProvides
(
isAppService
)
{
if
(
isAppService
)
{
...
...
@@ -35,7 +36,8 @@ function getProvides (isAppService) {
'
Component
'
:
[
runtimePath
,
'
Component
'
],
'
Behavior
'
:
[
runtimePath
,
'
Behavior
'
],
'
getDate
'
:
[
wxsPath
,
'
getDate
'
],
'
getRegExp
'
:
[
wxsPath
,
'
getRegExp
'
]
'
getRegExp
'
:
[
wxsPath
,
'
getRegExp
'
],
'
uniCloud
'
:
[
uniCloudPath
,
'
default
'
]
}
}
return
{
// app-view
...
...
packages/vue-cli-plugin-uni/lib/chain-webpack.js
浏览文件 @
05a38735
...
...
@@ -94,7 +94,8 @@ module.exports = function chainWebpack (platformOptions, vueOptions, api) {
webpackConfig
.
plugin
(
'
uni-define
'
)
.
use
(
require
.
resolve
(
'
webpack/lib/DefinePlugin
'
),
[{
'
process.env.UNI_ENV
'
:
JSON
.
stringify
(
process
.
env
.
UNI_PLATFORM
)
'
process.env.UNI_ENV
'
:
JSON
.
stringify
(
process
.
env
.
UNI_PLATFORM
),
'
process.env.UNI_CLOUD_PROVIDER
'
:
process
.
env
.
UNI_CLOUD_PROVIDER
}])
if
(
runByHBuilderX
)
{
// 由 HBuilderX 运行时,移除进度,错误
...
...
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
05a38735
...
...
@@ -3,6 +3,30 @@ const path = require('path')
const
mkdirp
=
require
(
'
mkdirp
'
)
const
loaderUtils
=
require
(
'
loader-utils
'
)
process
.
env
.
UNI_CLOUD_PROVIDER
=
JSON
.
stringify
({})
if
(
process
.
env
.
UNI_CLOUD_SPACES
)
{
try
{
const
spaces
=
JSON
.
parse
(
process
.
env
.
UNI_CLOUD_SPACES
)
if
(
Array
.
isArray
(
spaces
)
&&
spaces
.
length
===
1
)
{
const
space
=
spaces
[
0
]
if
(
space
.
clientSecret
)
{
process
.
env
.
UNI_CLOUD_PROVIDER
=
JSON
.
stringify
({
provider
:
'
aliyun
'
,
spaceId
:
space
.
name
,
clientSecret
:
space
.
clientSecret
,
endpoint
:
space
.
apiEndpoint
})
}
else
{
process
.
env
.
UNI_CLOUD_PROVIDER
=
JSON
.
stringify
({
provider
:
'
tencent
'
,
spaceId
:
space
.
name
})
}
}
}
catch
(
e
)
{}
}
if
(
process
.
env
.
UNI_PLATFORM
===
'
mp-360
'
)
{
process
.
env
.
UNI_PLATFORM
=
'
h5
'
process
.
env
.
UNI_SUB_PLATFORM
=
'
mp-360
'
...
...
packages/vue-cli-plugin-uni/lib/h5/index.js
浏览文件 @
05a38735
...
...
@@ -30,9 +30,11 @@ const {
const
runtimePath
=
'
@dcloudio/uni-mp-weixin/dist/mp.js
'
const
wxsPath
=
'
@dcloudio/uni-mp-weixin/dist/wxs.js
'
const
uniCloudPath
=
path
.
resolve
(
__dirname
,
'
../../packages/uni-cloud/dist/index.js
'
)
function
getProvides
()
{
return
{
'
uniCloud
'
:
[
uniCloudPath
,
'
default
'
],
'
wx.nextTick
'
:
[
runtimePath
,
'
nextTick
'
],
'
Page
'
:
[
runtimePath
,
'
Page
'
],
'
Component
'
:
[
runtimePath
,
'
Component
'
],
...
...
@@ -103,7 +105,7 @@ module.exports = {
`import 'uni-pages';import 'uni-
${
process
.
env
.
UNI_PLATFORM
}
';`
const
qihooCode
=
process
.
env
.
UNI_SUB_PLATFORM
===
'
mp-360
'
?
`
?
`
import 'uni-touch-emulator';
import qh from 'uni-qh';
global.qh = qh;
...
...
@@ -117,7 +119,7 @@ global.onAppShow = function(){};
alias
:
{
'
vue-router
'
:
resolve
(
'
packages/h5-vue-router
'
),
'
uni-h5
'
:
require
.
resolve
(
'
@dcloudio/uni-h5
'
),
'
uni-qh
'
:
path
.
resolve
(
__dirname
,
'
qh-api.js
'
),
'
uni-qh
'
:
path
.
resolve
(
__dirname
,
'
qh-api.js
'
),
'
uni-touch-emulator
'
:
path
.
resolve
(
__dirname
,
'
touch-emulator.js
'
)
}
},
...
...
packages/vue-cli-plugin-uni/lib/mp.js
浏览文件 @
05a38735
...
...
@@ -27,8 +27,10 @@ function createUniMPPlugin () {
function
getProvides
()
{
const
uniPath
=
require
.
resolve
(
'
@dcloudio/uni-
'
+
process
.
env
.
UNI_PLATFORM
)
const
uniCloudPath
=
path
.
resolve
(
__dirname
,
'
../packages/uni-cloud/dist/index.js
'
)
const
provides
=
{
'
uni
'
:
[
uniPath
,
'
default
'
]
'
uni
'
:
[
uniPath
,
'
default
'
],
'
uniCloud
'
:
[
uniCloudPath
,
'
default
'
]
}
if
(
process
.
env
.
UNI_USING_COMPONENTS
)
{
...
...
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
0 → 100644
浏览文件 @
05a38735
此差异已折叠。
点击以展开。
packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.v3.js
浏览文件 @
05a38735
...
...
@@ -24,7 +24,7 @@ function getTabBarPages (appJson) {
}
function
isTabBarPage
(
pathName
,
tabBarPages
)
{
return
tabBarPages
&&
tabBarPages
.
find
(
item
=>
item
.
pagePath
===
pathName
)
return
Array
.
isArray
(
tabBarPages
)
&&
tabBarPages
.
find
(
item
=>
item
.
pagePath
===
pathName
)
}
function
parseEntryPagePath
(
appJson
,
manifestJson
)
{
...
...
@@ -89,7 +89,7 @@ module.exports = function (appJson, manifestJson, {
path
:
entryPagePath
+
'
.js
'
+
(
appJson
.
entryPageQuery
||
''
)
}
const
tabBar
=
manifestJson
.
plus
.
tabBar
if
(
isTabBarPage
(
entryPagePath
,
tabBar
.
list
))
{
if
(
tabBar
&&
isTabBarPage
(
entryPagePath
,
tabBar
.
list
))
{
tabBar
.
child
=
[
'
lauchwebview
'
]
}
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录