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