Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
e02f9738
U
uni-app
项目概览
yangkaifeng
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
3
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,发现更多精彩内容 >>
提交
e02f9738
编写于
9月 15, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add BROWSERSLIST_CONFIG
上级
c7d99b2c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
13 deletion
+37
-13
.gitignore
.gitignore
+1
-0
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+32
-9
packages/webpack-uni-pages-loader/lib/index-new.js
packages/webpack-uni-pages-loader/lib/index-new.js
+4
-4
未找到文件。
.gitignore
浏览文件 @
e02f9738
...
...
@@ -7,3 +7,4 @@ unpackage/
!packages/uni-app-plus/dist
package-lock.json
!packages/vue-cli-plugin-uni/packages/**/*
tests/package.json
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
e02f9738
...
...
@@ -58,7 +58,9 @@ if (process.env.UNI_CLOUD_SPACES) {
const
hasUniCloudSpace
=
spaces
.
length
>
0
if
(
spaces
.
length
===
1
)
{
const
space
=
spaces
[
0
]
console
.
log
(
uniI18n
.
__
(
'
pluginUni.currentProjectDefaultSpaceId
'
,
{
0
:
space
.
id
}))
console
.
log
(
uniI18n
.
__
(
'
pluginUni.currentProjectDefaultSpaceId
'
,
{
0
:
space
.
id
}))
}
if
(
...
...
@@ -66,13 +68,17 @@ if (process.env.UNI_CLOUD_SPACES) {
isH5
&&
isProduction
)
{
console
.
warn
(
uniI18n
.
__
(
'
pluginUni.unicloudReleaseH5
'
,
{
0
:
'
https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5
'
}))
console
.
warn
(
uniI18n
.
__
(
'
pluginUni.unicloudReleaseH5
'
,
{
0
:
'
https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5
'
}))
}
else
if
(
hasUniCloudSpace
&&
isH5
&&
!
isProduction
)
{
console
.
warn
(
uniI18n
.
__
(
'
pluginUni.unicloudShowedRunByHBuilderX
'
,
{
0
:
'
https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5
'
}))
console
.
warn
(
uniI18n
.
__
(
'
pluginUni.unicloudShowedRunByHBuilderX
'
,
{
0
:
'
https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5
'
}))
}
process
.
env
.
UNI_CLOUD_PROVIDER
=
JSON
.
stringify
(
spaces
.
map
(
space
=>
{
...
...
@@ -122,6 +128,12 @@ if (process.env.NODE_ENV === 'production') { // 发行模式,不启用 cache
delete
process
.
env
.
UNI_USING_CACHE
}
process
.
env
.
BROWSERSLIST_CONFIG
=
[
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
.browserslistrc
'
),
path
.
resolve
(
process
.
env
.
UNI_CLI_CONTEXT
,
'
package.json
'
),
path
.
resolve
(
process
.
cwd
(),
'
package.json
'
)
].
find
(
file
=>
fs
.
existsSync
(
file
))
const
{
normalizePath
,
isSupportSubPackages
,
...
...
@@ -295,7 +307,9 @@ if (
process
.
env
.
UNI_USING_STAT
=
true
if
(
!
process
.
UNI_STAT_CONFIG
.
appid
&&
process
.
env
.
NODE_ENV
===
'
production
'
)
{
console
.
log
()
console
.
warn
(
uniI18n
.
__
(
'
pluginUni.uniStatisticsNoAppid
'
,
{
0
:
'
https://ask.dcloud.net.cn/article/36303
'
}))
console
.
warn
(
uniI18n
.
__
(
'
pluginUni.uniStatisticsNoAppid
'
,
{
0
:
'
https://ask.dcloud.net.cn/article/36303
'
}))
console
.
log
()
}
}
...
...
@@ -324,7 +338,10 @@ let hasNVue = false
const
compileModeUrl
=
'
https://ask.dcloud.net.cn/article/36074
'
if
(
process
.
env
.
UNI_USING_NATIVE
||
process
.
env
.
UNI_USING_V3_NATIVE
)
{
const
compileMode
=
(
process
.
env
.
UNI_USING_V3_NATIVE
?
'
(v3)
'
:
''
)
+
'
:
'
+
(
isNVueCompiler
?
'
uni-app
'
:
'
weex
'
)
console
.
log
(
uniI18n
.
__
(
'
pluginUni.nvueCompileModeForDetail
'
,
{
0
:
compileMode
,
1
:
compileModeUrl
}))
console
.
log
(
uniI18n
.
__
(
'
pluginUni.nvueCompileModeForDetail
'
,
{
0
:
compileMode
,
1
:
compileModeUrl
}))
}
else
if
(
process
.
env
.
UNI_PLATFORM
!==
'
h5
'
&&
process
.
env
.
UNI_PLATFORM
!==
'
quickapp-native
'
)
{
try
{
let
info
=
''
...
...
@@ -332,7 +349,8 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
const
pagesPkg
=
require
(
'
@dcloudio/webpack-uni-pages-loader/package.json
'
)
if
(
pagesPkg
)
{
const
v3Tips
=
`(v3)
${
uniI18n
.
__
(
'
see
'
)}
:https://ask.dcloud.net.cn/article/36599。`
info
=
uniI18n
.
__
(
'
compilerVersion
'
)
+
'
:
'
+
pagesPkg
[
'
uni-app
'
].
compilerVersion
+
(
process
.
env
.
UNI_USING_V3
?
v3Tips
:
''
)
info
=
uniI18n
.
__
(
'
compilerVersion
'
)
+
'
:
'
+
pagesPkg
[
'
uni-app
'
].
compilerVersion
+
(
process
.
env
.
UNI_USING_V3
?
v3Tips
:
''
)
}
if
(
process
.
env
.
UNI_USING_V3
)
{
console
.
log
(
info
)
...
...
@@ -346,7 +364,10 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
if
(
needWarning
)
{
console
.
log
(
warningMsg
)
}
console
.
log
(
uniI18n
.
__
(
'
pluginUni.nvueCompileModeForDetail
'
,
{
0
:
(
isNVueCompiler
?
'
uni-app
'
:
'
weex
'
),
1
:
compileModeUrl
}))
console
.
log
(
uniI18n
.
__
(
'
pluginUni.nvueCompileModeForDetail
'
,
{
0
:
(
isNVueCompiler
?
'
uni-app
'
:
'
weex
'
),
1
:
compileModeUrl
}))
}
else
{
console
.
log
(
info
)
if
(
needWarning
)
{
...
...
@@ -467,11 +488,13 @@ if (
}
if
(
process
.
env
.
UNI_PLATFORM
.
startsWith
(
'
mp-
'
))
{
console
.
log
(
uniI18n
.
__
(
'
pluginUni.mpBrowserKernelDifference
'
,
{
0
:
'
https://uniapp.dcloud.io/matter?id=mp
'
}))
console
.
log
(
uniI18n
.
__
(
'
pluginUni.mpBrowserKernelDifference
'
,
{
0
:
'
https://uniapp.dcloud.io/matter?id=mp
'
}))
}
runByHBuilderX
&&
console
.
log
(
uniI18n
.
__
(
'
compiling
'
))
module
.
exports
=
{
manifestPlatformOptions
:
platformOptions
}
}
packages/webpack-uni-pages-loader/lib/index-new.js
浏览文件 @
e02f9738
...
...
@@ -38,7 +38,7 @@ const {
}
=
require
(
'
@dcloudio/uni-i18n
'
)
// 将开发者手动设置的 usingComponents 调整名称,方便与自动解析到的 usingComponents 做最后合并
function
renameUsingComponents
(
jsonObj
)
{
function
renameUsingComponents
(
jsonObj
)
{
if
(
jsonObj
.
usingComponents
)
{
jsonObj
.
customUsingComponents
=
jsonObj
.
usingComponents
delete
jsonObj
.
usingComponents
...
...
@@ -46,7 +46,7 @@ function renameUsingComponents(jsonObj) {
return
jsonObj
}
module
.
exports
=
function
(
content
,
map
)
{
module
.
exports
=
function
(
content
,
map
)
{
this
.
cacheable
&&
this
.
cacheable
()
initTheme
()
...
...
@@ -136,13 +136,13 @@ module.exports = function(content, map) {
if
(
!
process
.
env
.
UNI_USING_V3
)
{
parsePages
(
pagesJson
,
function
(
page
)
{
function
(
page
)
{
updatePageJson
(
page
.
path
,
renameUsingComponents
(
parseStyle
(
page
.
style
))
)
},
function
(
root
,
page
)
{
function
(
root
,
page
)
{
updatePageJson
(
normalizePath
(
path
.
join
(
root
,
page
.
path
)),
renameUsingComponents
(
parseStyle
(
page
.
style
,
root
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录