Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
7dfd02b1
U
uni-app
项目概览
DCloud
/
uni-app
大约 1 个月 前同步成功
通知
702
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,发现更多精彩内容 >>
提交
7dfd02b1
编写于
6月 17, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(h5): build target
上级
2731f062
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
1454 addition
and
138 deletion
+1454
-138
packages/playground/ssr/package.json
packages/playground/ssr/package.json
+1
-1
packages/playground/ssr/yarn.lock
packages/playground/ssr/yarn.lock
+7
-7
packages/size-check/package.json
packages/size-check/package.json
+1
-1
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+6
-2
packages/uni-h5/vite.config.ts
packages/uni-h5/vite.config.ts
+20
-5
rollup.config.js
rollup.config.js
+27
-18
yarn.lock
yarn.lock
+1392
-104
未找到文件。
packages/playground/ssr/package.json
浏览文件 @
7dfd02b1
...
...
@@ -18,7 +18,7 @@
"@dcloudio/uni-shared"
:
"../../uni-shared"
,
"@vue/shared"
:
"^3.1.1"
,
"vue"
:
"^3.1.1"
,
"vue-router"
:
"^4.0.
8
"
,
"vue-router"
:
"^4.0.
9
"
,
"vuex"
:
"^4.0.1"
},
"devDependencies"
:
{
...
...
packages/playground/ssr/yarn.lock
浏览文件 @
7dfd02b1
...
...
@@ -1819,9 +1819,9 @@ postcss-value-parser@^4.1.0:
integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==
postcss@^8.1.10, postcss@^8.3.0:
version "8.3.
4
"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.
4.tgz#41ece1c43f2f7c74dc7d90144047ce052757b822
"
integrity sha512-
/tZY0PXExXXnNhKv3TOvZAOUYRyuqcCbBm2c17YMDK0PlVII3K7/LKdt3ScHL+hhouddjUWi+1sKDf9xXW+8Y
A==
version "8.3.
5
"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.
5.tgz#982216b113412bc20a86289e91eb994952a5b709
"
integrity sha512-
NxTuJocUhYGsMiMFHDUkmjSKT3EdH4/WbGF6GCi1NDGk+vbcUTun4fpbOqaPtD8IIsztA2ilZm2DhYCuyN58g
A==
dependencies:
colorette "^1.2.2"
nanoid "^3.1.23"
...
...
@@ -1958,9 +1958,9 @@ rollup-plugin-copy@^3.4.0:
is-plain-object "^3.0.0"
rollup@^2.38.5:
version "2.52.
0
"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.52.
0.tgz#9df3de6028fae79569a985942b81110205a5a411
"
integrity sha512-
lSkBDGsVoXjqaBf7dsHwxBJz+p+hJEP72P+LOitA0yVs+Nzxj76FidkZE2thrmhjwGqLYiJo39opi7mAfaQ/Vg
==
version "2.52.
1
"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.52.
1.tgz#dd1cc178d70cf35c48d943fc06fdc32d546e6876
"
integrity sha512-
/SPqz8UGnp4P1hq6wc9gdTqA2bXQXGx13TtoL03GBm6qGRI6Hm3p4Io7GeiHNLl0BsQAne1JNYY+q/apcY933w
==
optionalDependencies:
fsevents "~2.3.2"
...
...
@@ -2312,7 +2312,7 @@ vite@^2.3.7:
optionalDependencies:
fsevents "~2.3.1"
vue-router@^4.0.
8
:
vue-router@^4.0.
9
:
version "4.0.9"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.0.9.tgz#248496941b79c4c1010f6ebfcf235cd4267d85da"
integrity sha512-i3IaZJ57YeMbRHQlqKyXdUMr5NzTCcJkn3f8u38TsZjYWtGcd3IX2zRd3389SCOwuRf11mgfHAyngR6FVDE9og==
...
...
packages/size-check/package.json
浏览文件 @
7dfd02b1
...
...
@@ -3,6 +3,6 @@
"name"
:
"@dcloudio/size-check"
,
"version"
:
"3.0.0-alpha-3000020210611006"
,
"dependencies"
:
{
"vue-router"
:
"^4.0.
8
"
"vue-router"
:
"^4.0.
9
"
}
}
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
7dfd02b1
...
...
@@ -10719,7 +10719,10 @@ function useProvideRadioGroup(props2, trigger) {
onMounted(() => {
_resetRadioGroupValue(fields2.length - 1);
});
const getFieldsValue = () => fields2.find((field) => field.value.radioChecked)?.value.value;
const getFieldsValue = () => {
var _a;
return (_a = fields2.find((field) => field.value.radioChecked)) == null ? void 0 : _a.value.value;
};
provide(uniRadioGroupKey, {
addField(field) {
fields2.push(field);
...
...
@@ -18372,7 +18375,8 @@ function useState() {
});
const props2 = ["topWindow", "leftWindow", "rightWindow"];
props2.forEach((prop) => {
const matchMedia = __uniConfig[prop]?.matchMedia;
var _a;
const matchMedia = (_a = __uniConfig[prop]) == null ? void 0 : _a.matchMedia;
let topWindowMinWidth = RESPONSIVE_MIN_WIDTH;
if (matchMedia && hasOwn(matchMedia, "minWidth")) {
const minWidth = matchMedia.minWidth;
...
...
packages/uni-h5/vite.config.ts
浏览文件 @
7dfd02b1
...
...
@@ -8,6 +8,8 @@ import replace from '@rollup/plugin-replace'
import
vue
from
'
@vitejs/plugin-vue
'
import
vueJsx
from
'
@vitejs/plugin-vue-jsx
'
import
{
OutputChunk
}
from
'
rollup
'
import
{
stripOptions
}
from
'
@dcloudio/uni-cli-shared
'
import
{
isCustomElement
}
from
'
@dcloudio/uni-shared
'
...
...
@@ -25,10 +27,7 @@ const rollupPlugins = [
defineTaskApi
:
`/*#__PURE__*/ defineTaskApi`
,
defineSyncApi
:
`/*#__PURE__*/ defineSyncApi`
,
defineAsyncApi
:
`/*#__PURE__*/ defineAsyncApi`
,
__IMPORT_META_ENV_BASE_URL__
:
FORMAT
===
'
cjs
'
?
'
__IMPORT_META_ENV_BASE_URL__
'
:
'
import.meta.env.BASE_URL
'
,
//直接使用import.meta.env.BASE_URL会被vite替换成'/'
__IMPORT_META_ENV_BASE_URL__
:
'
__IMPORT_META_ENV_BASE_URL__
'
,
//直接使用import.meta.env.BASE_URL会被vite替换成'/'
},
preventAssignment
:
true
,
}),
...
...
@@ -45,6 +44,22 @@ const rollupPlugins = [
if
(
FORMAT
===
'
cjs
'
)
{
rollupPlugins
.
push
(
strip
(
stripOptions
))
}
if
(
FORMAT
===
'
es
'
)
{
// 解决import.meta被转换为import_meta的问题
rollupPlugins
.
push
({
name
:
'
import-meta
'
,
generateBundle
(
_options
,
bundle
)
{
const
esBundle
=
bundle
[
'
uni-h5.es.js
'
]
as
unknown
as
OutputChunk
if
(
esBundle
)
{
esBundle
.
code
=
esBundle
.
code
.
replace
(
'
__IMPORT_META_ENV_BASE_URL__
'
,
'
import.meta.env.BASE_URL
'
)
}
},
})
}
export
default
defineConfig
({
root
:
__dirname
,
define
:
{
...
...
@@ -89,7 +104,7 @@ export default defineConfig({
vueJsx
({
optimize
:
true
,
isCustomElement
}),
],
build
:
{
target
:
FORMAT
===
'
cjs
'
?
'
modules
'
:
'
es2020
'
,
// keep import.meta...
target
:
'
modules
'
,
// keep import.meta...
emptyOutDir
:
FORMAT
===
'
es
'
,
minify
:
false
,
lib
:
{
...
...
rollup.config.js
浏览文件 @
7dfd02b1
...
...
@@ -20,25 +20,32 @@ let hasTSChecked = false
const
configs
=
[]
const
buildOptions
=
require
(
resolve
(
`build.json`
))
function
normalizeOutput
(
file
,
output
=
{})
{
return
Object
.
assign
(
{
file
,
format
:
file
.
includes
(
'
.cjs.
'
)
?
'
cjs
'
:
'
es
'
,
exports
:
'
auto
'
,
},
output
)
}
Object
.
keys
(
buildOptions
.
input
).
forEach
((
name
)
=>
{
const
files
=
buildOptions
.
input
[
name
]
if
(
Array
.
isArray
(
files
))
{
files
.
forEach
((
file
)
=>
{
configs
.
push
(
createConfig
(
name
,
{
file
:
resolve
(
file
),
format
:
file
.
includes
(
'
.cjs.
'
)
?
'
cjs
'
:
'
es
'
,
exports
:
'
auto
'
,
})
createConfig
(
name
,
normalizeOutput
(
resolve
(
file
),
buildOptions
.
output
))
)
})
}
else
{
configs
.
push
(
createConfig
(
name
,
{
file
:
resolve
(
buildOptions
.
input
[
name
]),
format
:
(
buildOptions
.
output
&&
buildOptions
.
output
.
format
)
||
`es`
,
exports
:
'
auto
'
,
})
createConfig
(
name
,
normalizeOutput
(
resolve
(
buildOptions
.
input
[
name
]),
buildOptions
.
output
)
)
)
}
})
...
...
@@ -46,7 +53,6 @@ export default configs
function
createConfig
(
entryFile
,
output
,
plugins
=
[])
{
const
shouldEmitDeclarations
=
process
.
env
.
TYPES
!=
null
&&
!
hasTSChecked
const
tsPlugin
=
ts
({
check
:
!
process
.
env
.
CI
&&
process
.
env
.
NODE_ENV
===
'
production
'
&&
!
hasTSChecked
,
...
...
@@ -67,13 +73,16 @@ function createConfig(entryFile, output, plugins = []) {
// during a single build.
hasTSChecked
=
true
const
external
=
[
'
vue
'
,
'
@vue/shared
'
,
...
Object
.
keys
(
pkg
.
dependencies
||
{}),
...
Object
.
keys
(
pkg
.
peerDependencies
||
{}),
...(
buildOptions
.
external
||
[]),
]
const
external
=
buildOptions
.
external
===
false
?
[]
:
[
'
vue
'
,
'
@vue/shared
'
,
...
Object
.
keys
(
pkg
.
dependencies
||
{}),
...
Object
.
keys
(
pkg
.
peerDependencies
||
{}),
...(
buildOptions
.
external
||
[]),
]
return
{
input
:
resolve
(
entryFile
),
...
...
yarn.lock
浏览文件 @
7dfd02b1
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录