Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qianlong66
uni-app
提交
8b87da13
U
uni-app
项目概览
qianlong66
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8b87da13
编写于
6月 25, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(types): @dcloudio/uni-platform
上级
c3742945
变更
54
展开全部
隐藏空白更改
内联
并排
Showing
54 changed file
with
33882 addition
and
4741 deletion
+33882
-4741
packages/uni-api/src/service/base/upx2px.ts
packages/uni-api/src/service/base/upx2px.ts
+1
-1
packages/uni-api/src/service/context/canvas.ts
packages/uni-api/src/service/context/canvas.ts
+1
-1
packages/uni-api/src/service/ui/createSelectorQuery.ts
packages/uni-api/src/service/ui/createSelectorQuery.ts
+24
-21
packages/uni-app-plus/build.json
packages/uni-app-plus/build.json
+1
-1
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+4334
-774
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+5037
-89
packages/uni-app-plus/package.json
packages/uni-app-plus/package.json
+1
-0
packages/uni-app-plus/src/platform/index.ts
packages/uni-app-plus/src/platform/index.ts
+57
-10
packages/uni-app-plus/src/service/api/context/createInnerAudioContext.ts
...p-plus/src/service/api/context/createInnerAudioContext.ts
+2
-1
packages/uni-app-plus/src/service/api/context/getBackgroundAudioManager.ts
...plus/src/service/api/context/getBackgroundAudioManager.ts
+1
-1
packages/uni-app-plus/src/service/api/file/openDocument.ts
packages/uni-app-plus/src/service/api/file/openDocument.ts
+1
-1
packages/uni-app-plus/src/service/api/media/previewImage.ts
packages/uni-app-plus/src/service/api/media/previewImage.ts
+2
-2
packages/uni-app-plus/src/service/index.ts
packages/uni-app-plus/src/service/index.ts
+3
-0
packages/uni-app-plus/src/view/index.ts
packages/uni-app-plus/src/view/index.ts
+2
-1
packages/uni-app-plus/tsconfig.json
packages/uni-app-plus/tsconfig.json
+9
-0
packages/uni-app-plus/vite.config.ts
packages/uni-app-plus/vite.config.ts
+15
-11
packages/uni-app-vue/build.json
packages/uni-app-vue/build.json
+17
-9
packages/uni-app-vue/dist/service.runtime.esm.js
packages/uni-app-vue/dist/service.runtime.esm.js
+10026
-0
packages/uni-app-vue/dist/view.runtime.esm.js
packages/uni-app-vue/dist/view.runtime.esm.js
+9934
-0
packages/uni-app-vue/lib/service.runtime.esm.js
packages/uni-app-vue/lib/service.runtime.esm.js
+360
-94
packages/uni-app-vue/lib/view.runtime.esm.js
packages/uni-app-vue/lib/view.runtime.esm.js
+3836
-3589
packages/uni-app-vue/src/index.ts
packages/uni-app-vue/src/index.ts
+0
-3
packages/uni-app-vue/src/service/index.ts
packages/uni-app-vue/src/service/index.ts
+2
-0
packages/uni-app-vue/src/view/index.ts
packages/uni-app-vue/src/view/index.ts
+1
-0
packages/uni-h5/src/platform/dom.ts
packages/uni-h5/src/platform/dom.ts
+1
-1
packages/uni-h5/src/service/api/ui/requestComponentInfo.ts
packages/uni-h5/src/service/api/ui/requestComponentInfo.ts
+12
-24
packages/uni-h5/tsconfig.json
packages/uni-h5/tsconfig.json
+9
-0
packages/uni-i18n/tsconfig.json
packages/uni-i18n/tsconfig.json
+2
-1
packages/uni-mp-alipay/dist/uni.api.esm.js
packages/uni-mp-alipay/dist/uni.api.esm.js
+4
-4
packages/uni-mp-alipay/src/platform/index.ts
packages/uni-mp-alipay/src/platform/index.ts
+0
-1
packages/uni-mp-alipay/tsconfig.json
packages/uni-mp-alipay/tsconfig.json
+12
-0
packages/uni-mp-baidu/dist/uni.api.esm.js
packages/uni-mp-baidu/dist/uni.api.esm.js
+4
-4
packages/uni-mp-baidu/src/platform/index.ts
packages/uni-mp-baidu/src/platform/index.ts
+0
-1
packages/uni-mp-baidu/tsconfig.json
packages/uni-mp-baidu/tsconfig.json
+10
-0
packages/uni-mp-core/src/api/index.ts
packages/uni-mp-core/src/api/index.ts
+5
-1
packages/uni-mp-core/src/api/promise.ts
packages/uni-mp-core/src/api/promise.ts
+5
-1
packages/uni-mp-core/src/platform/index.ts
packages/uni-mp-core/src/platform/index.ts
+0
-11
packages/uni-mp-qq/dist/uni.api.esm.js
packages/uni-mp-qq/dist/uni.api.esm.js
+4
-4
packages/uni-mp-qq/src/platform/index.ts
packages/uni-mp-qq/src/platform/index.ts
+0
-1
packages/uni-mp-qq/tsconfig.json
packages/uni-mp-qq/tsconfig.json
+10
-0
packages/uni-mp-toutiao/dist/uni.api.esm.js
packages/uni-mp-toutiao/dist/uni.api.esm.js
+4
-4
packages/uni-mp-toutiao/src/platform/index.ts
packages/uni-mp-toutiao/src/platform/index.ts
+0
-1
packages/uni-mp-toutiao/tsconfig.json
packages/uni-mp-toutiao/tsconfig.json
+12
-0
packages/uni-mp-weixin/dist/uni.api.esm.js
packages/uni-mp-weixin/dist/uni.api.esm.js
+4
-4
packages/uni-mp-weixin/src/platform/index.ts
packages/uni-mp-weixin/src/platform/index.ts
+0
-1
packages/uni-mp-weixin/tsconfig.json
packages/uni-mp-weixin/tsconfig.json
+12
-0
packages/uni-quickapp-webview/dist/uni.api.esm.js
packages/uni-quickapp-webview/dist/uni.api.esm.js
+4
-4
packages/uni-quickapp-webview/src/platform/index.ts
packages/uni-quickapp-webview/src/platform/index.ts
+0
-1
packages/uni-quickapp-webview/tsconfig.json
packages/uni-quickapp-webview/tsconfig.json
+12
-0
packages/uni-shared/tsconfig.json
packages/uni-shared/tsconfig.json
+2
-0
packages/vite-plugin-uni/package.json
packages/vite-plugin-uni/package.json
+1
-1
rollup.config.js
rollup.config.js
+54
-29
tsconfig.json
tsconfig.json
+1
-7
yarn.lock
yarn.lock
+31
-26
未找到文件。
packages/uni-api/src/service/base/upx2px.ts
浏览文件 @
8b87da13
...
...
@@ -16,7 +16,7 @@ function checkDeviceWidth() {
const
{
platform
,
pixelRatio
,
windowWidth
}
=
getBaseSystemInfo
()
deviceWidth
=
windowWidth
as
number
deviceDPR
=
pixelRatio
as
number
isIOS
=
platform
===
'
ios
'
isIOS
=
(
platform
as
string
)
===
'
ios
'
}
function
checkValue
(
value
:
unknown
,
defaultValue
:
number
)
{
...
...
packages/uni-api/src/service/context/canvas.ts
浏览文件 @
8b87da13
...
...
@@ -458,7 +458,7 @@ export class CanvasContext implements UniApp.CanvasContext {
.
find
((
webview
)
=>
webview
.
getURL
().
endsWith
(
'
www/__uniappview.html
'
))
if
(
webview
)
{
width
=
Number
(
webview
.
evalJSSync
(
(
webview
as
any
)
.
evalJSSync
(
`(
${
measureText
.
toString
()}
)(
${
JSON
.
stringify
(
text
)}
,
${
JSON
.
stringify
(
font
)}
)`
...
...
packages/uni-api/src/service/ui/createSelectorQuery.ts
浏览文件 @
8b87da13
...
...
@@ -6,15 +6,23 @@ import { EditorContext } from '../context/editor'
import
{
MapContext
}
from
'
../context/createMapContext
'
import
{
VideoContext
}
from
'
../context/createVideoContext
'
import
{
requestComponentInfo
}
from
'
@dcloudio/uni-platform
'
import
{
getContextInfo
}
from
'
@dcloudio/uni-components
'
type
NodeField
=
UniApp
.
NodeField
type
ContextType
=
'
canvas
'
|
'
map
'
|
'
video
'
|
'
editor
'
interface
NodeInfo
extends
UniApp
.
NodeInfo
{
contextInfo
?:
{
id
:
string
type
:
ContextType
page
:
number
}
export
interface
SelectorQueryNodeInfo
extends
UniApp
.
NodeInfo
,
Omit
<
Partial
<
Record
<
keyof
CSSStyleDeclaration
,
any
>>
,
'
top
'
|
'
bottom
'
|
'
left
'
|
'
right
'
|
'
height
'
|
'
width
'
>
{
contextInfo
?:
ReturnType
<
typeof
getContextInfo
>
}
export
interface
SelectorQueryRequest
{
component
:
ComponentPublicInstance
|
undefined
|
null
selector
:
string
single
:
boolean
fields
:
NodeField
}
const
ContextClasss
=
{
...
...
@@ -24,9 +32,9 @@ const ContextClasss = {
editor
:
EditorContext
,
}
function
convertContext
(
result
:
NodeInfo
|
null
)
{
function
convertContext
(
result
:
SelectorQuery
NodeInfo
|
null
)
{
if
(
result
&&
result
.
contextInfo
)
{
const
{
id
,
type
,
page
}
=
(
result
as
NodeInfo
).
contextInfo
!
const
{
id
,
type
,
page
}
=
(
result
as
SelectorQuery
NodeInfo
).
contextInfo
!
const
ContextClass
=
ContextClasss
[
type
]
result
.
context
=
new
ContextClass
(
id
,
page
)
delete
result
.
contextInfo
...
...
@@ -50,7 +58,7 @@ class NodesRef implements UniApp.NodesRef {
this
.
_single
=
single
}
boundingClientRect
(
callback
:
(
result
:
NodeInfo
)
=>
void
)
{
boundingClientRect
(
callback
:
(
result
:
SelectorQuery
NodeInfo
)
=>
void
)
{
this
.
_selectorQuery
.
_push
(
this
.
_selector
,
this
.
_component
,
...
...
@@ -66,7 +74,7 @@ class NodesRef implements UniApp.NodesRef {
return
this
.
_selectorQuery
}
fields
(
fields
:
NodeField
,
callback
:
(
result
:
NodeInfo
)
=>
void
)
{
fields
(
fields
:
NodeField
,
callback
:
(
result
:
SelectorQuery
NodeInfo
)
=>
void
)
{
this
.
_selectorQuery
.
_push
(
this
.
_selector
,
this
.
_component
,
...
...
@@ -77,7 +85,7 @@ class NodesRef implements UniApp.NodesRef {
return
this
.
_selectorQuery
}
scrollOffset
(
callback
:
(
result
:
NodeInfo
)
=>
void
)
{
scrollOffset
(
callback
:
(
result
:
SelectorQuery
NodeInfo
)
=>
void
)
{
this
.
_selectorQuery
.
_push
(
this
.
_selector
,
this
.
_component
,
...
...
@@ -92,7 +100,7 @@ class NodesRef implements UniApp.NodesRef {
return
this
.
_selectorQuery
}
context
(
callback
:
(
result
:
NodeInfo
)
=>
void
)
{
context
(
callback
:
(
result
:
SelectorQuery
NodeInfo
)
=>
void
)
{
this
.
_selectorQuery
.
_push
(
this
.
_selector
,
this
.
_component
,
...
...
@@ -108,12 +116,7 @@ class NodesRef implements UniApp.NodesRef {
class
SelectorQuery
implements
UniApp
.
SelectorQuery
{
private
_page
:
ComponentPublicInstance
private
_queue
:
Array
<
{
component
:
ComponentPublicInstance
|
undefined
|
null
selector
:
string
single
:
boolean
fields
:
NodeField
}
>
private
_queue
:
Array
<
SelectorQueryRequest
>
private
_component
?:
ComponentPublicInstance
=
undefined
private
_queueCb
:
any
[]
private
_nodesRef
?:
NodesRef
...
...
@@ -127,7 +130,7 @@ class SelectorQuery implements UniApp.SelectorQuery {
requestComponentInfo
(
this
.
_page
,
this
.
_queue
,
(
res
:
Array
<
NodeInfo
|
null
>
)
=>
{
(
res
:
Array
<
SelectorQuery
NodeInfo
|
null
>
)
=>
{
const
queueCbs
=
this
.
_queueCb
res
.
forEach
((
result
,
index
)
=>
{
if
(
Array
.
isArray
(
result
))
{
...
...
@@ -182,7 +185,7 @@ class SelectorQuery implements UniApp.SelectorQuery {
component
:
ComponentPublicInstance
|
undefined
|
null
,
single
:
boolean
,
fields
:
NodeField
,
callback
:
(
result
:
NodeInfo
)
=>
void
callback
:
(
result
:
SelectorQuery
NodeInfo
)
=>
void
)
{
this
.
_queue
.
push
({
component
,
...
...
packages/uni-app-plus/build.json
浏览文件 @
8b87da13
...
...
@@ -5,7 +5,7 @@
"output"
:
{
"name"
:
"serviceContext"
,
"format"
:
"iife"
,
"banner"
:
"export function createServiceContext(Vue, weex, plus,
UniServiceJSBridge,
instanceContext){
\n
const setTimeout = instanceContext.setTimeout;
\n
const clearTimeout = instanceContext.clearTimeout;
\n
const setInterval = instanceContext.setInterval;
\n
const clearInterval = instanceContext.clearInterval;
\n
const __uniConfig = instanceContext.__uniConfig;
\n
const __uniRoutes = instanceContext.__uniRoutes;
\n
"
,
"banner"
:
"export function createServiceContext(Vue, weex, plus,instanceContext){
\n
const setTimeout = instanceContext.setTimeout;
\n
const clearTimeout = instanceContext.clearTimeout;
\n
const setInterval = instanceContext.setInterval;
\n
const clearInterval = instanceContext.clearInterval;
\n
const __uniConfig = instanceContext.__uniConfig;
\n
const __uniRoutes = instanceContext.__uniRoutes;
\n
"
,
"footer"
:
"const uni = serviceContext.uni;
\n
const getApp = serviceContext.getApp;
\n
const getCurrentPages = serviceContext.getCurrentPages;
\n
const __definePage = serviceContext.__definePage;
\n
const __registerPage = serviceContext.__registerPage;
\n
return serviceContext;
\n
}"
},
"external"
:
false
...
...
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
8b87da13
此差异已折叠。
点击以展开。
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
8b87da13
此差异已折叠。
点击以展开。
packages/uni-app-plus/package.json
浏览文件 @
8b87da13
...
...
@@ -17,6 +17,7 @@
"url"
:
"https://github.com/dcloudio/uni-app/issues"
},
"dependencies"
:
{
"@webcomponents/custom-elements"
:
"^1.4.3"
,
"vue3-webcomponent-wrapper"
:
"^0.1.4"
},
"gitHead"
:
"56deaeb47d42e924d10282d7af418ccee6b139bf"
...
...
packages/uni-app-plus/src/platform/index.ts
浏览文件 @
8b87da13
import
{
ComponentPublicInstance
}
from
'
vue
'
import
{
AddIntersectionObserverArgs
,
AddMediaQueryObserverArgs
,
RemoveIntersectionObserverArgs
,
RemoveMediaQueryObserverArgs
,
SelectorQueryNodeInfo
,
SelectorQueryRequest
,
}
from
'
@dcloudio/uni-api
'
export
function
getBaseSystemInfo
()
{
return
{}
// TODO
return
{
platform
:
''
,
pixelRatio
:
1
,
windowWidth
:
750
,
}
}
export
{
getRealPath
}
from
'
./getRealPath
'
export
function
operateVideoPlayer
()
{}
export
function
operateMap
()
{}
export
function
requestComponentInfo
()
{}
export
function
addIntersectionObserver
()
{}
export
function
removeIntersectionObserver
()
{}
export
function
addMediaQueryObserver
()
{}
export
function
removeMediaQueryObserver
()
{}
export
function
saveImage
()
{}
export
function
getSameOriginUrl
()
{}
export
function
operateVideoPlayer
(
videoId
:
string
,
pageId
:
number
,
type
:
string
,
data
?:
unknown
)
{}
export
function
operateMap
(
id
:
string
,
pageId
:
number
,
type
:
string
,
data
?:
unknown
)
{}
export
function
requestComponentInfo
(
page
:
ComponentPublicInstance
,
reqs
:
Array
<
SelectorQueryRequest
>
,
callback
:
(
result
:
Array
<
SelectorQueryNodeInfo
|
null
>
)
=>
void
)
{}
export
function
addIntersectionObserver
(
args
:
AddIntersectionObserverArgs
,
pageId
:
number
)
{}
export
function
removeIntersectionObserver
(
args
:
RemoveIntersectionObserverArgs
,
pageId
:
number
)
{}
export
function
addMediaQueryObserver
(
args
:
AddMediaQueryObserverArgs
,
pageId
:
number
)
{}
export
function
removeMediaQueryObserver
(
args
:
RemoveMediaQueryObserverArgs
,
pageId
:
number
)
{}
export
function
saveImage
(
base64
:
string
,
dirname
:
string
,
callback
:
(
error
:
Error
|
null
,
tempFilePath
:
string
)
=>
void
)
{}
export
function
getSameOriginUrl
(
url
:
string
):
Promise
<
string
>
{
return
Promise
.
resolve
(
url
)
}
export
const
TEMP_PATH
=
''
packages/uni-app-plus/src/service/api/context/createInnerAudioContext.ts
浏览文件 @
8b87da13
import
{
extend
}
from
'
@vue/shared
'
import
{
getRealPath
}
from
'
@dcloudio/uni-platform
'
import
{
API_CREATE_INNER_AUDIO_CONTEXT
,
defineSyncApi
,
...
...
@@ -12,6 +11,8 @@ import {
innerAudioContextOffEventNames
,
}
from
'
@dcloudio/uni-api
'
import
{
getRealPath
}
from
'
../../../platform/getRealPath
'
type
ExtendAudio
=
{
src
?:
string
volume
?:
number
...
...
packages/uni-app-plus/src/service/api/context/getBackgroundAudioManager.ts
浏览文件 @
8b87da13
...
...
@@ -5,7 +5,7 @@ import {
API_TYPE_GET_BACKGROUND_AUDIO_MANAGER
,
}
from
'
@dcloudio/uni-api
'
import
{
once
}
from
'
@dcloudio/uni-shared
'
import
{
getRealPath
}
from
'
@dcloudio/uni-platform
'
import
{
getRealPath
}
from
'
../../../platform/getRealPath
'
type
eventNames
=
|
'
canplay
'
...
...
packages/uni-app-plus/src/service/api/file/openDocument.ts
浏览文件 @
8b87da13
...
...
@@ -6,7 +6,7 @@ import {
OpenDocumentOptions
,
}
from
'
@dcloudio/uni-api
'
import
{
getRealPath
}
from
'
@dcloudio/uni-platform
'
import
{
getRealPath
}
from
'
../../../platform/getRealPath
'
export
const
openDocument
=
defineAsyncApi
<
API_TYPE_OPEN_DOCUMENT
>
(
API_OPEN_DOCUMENT
,
({
filePath
,
fileType
},
{
resolve
,
reject
})
=>
{
...
...
packages/uni-app-plus/src/service/api/media/previewImage.ts
浏览文件 @
8b87da13
...
...
@@ -6,12 +6,12 @@ import {
PreviewImageOptions
,
}
from
'
@dcloudio/uni-api
'
import
{
getRealPath
}
from
'
@dcloudio/uni-platform
'
import
{
isPlainObject
}
from
'
@vue/shared
'
import
{
initI18nChooseImageMsgsOnce
,
useI18n
}
from
'
@dcloudio/uni-core
'
import
{
getRealPath
}
from
'
../../../platform/getRealPath
'
export
const
previewImage
=
<
API_TYPE_PREVIEW_IMAGE
>
defineAsyncApi
(
API_PREVIEW_IMAGE
,
(
...
...
packages/uni-app-plus/src/service/index.ts
浏览文件 @
8b87da13
import
*
as
uni
from
'
./api
'
import
{
registerApp
as
__registerApp
}
from
'
./framework/app
'
import
{
registerPage
as
__registerPage
}
from
'
./framework/page
'
// ;(uni as any).__$wx__ = uni
export
default
{
uni
,
__registerApp
,
__registerPage
,
}
packages/uni-app-plus/src/view/index.ts
浏览文件 @
8b87da13
import
{
initView
}
from
'
@dcloudio/uni-core
'
import
'
@webcomponents/custom-elements
'
import
'
./components
'
packages/uni-app-plus/tsconfig.json
0 → 100644
浏览文件 @
8b87da13
{
"extends"
:
"../../tsconfig.json"
,
"compilerOptions"
:
{
"paths"
:
{
"@dcloudio/*"
:
[
"packages/*/src"
],
"@dcloudio/uni-platform"
:
[
"packages/uni-app-plus/src/platform/index.ts"
]
}
}
}
packages/uni-app-plus/vite.config.ts
浏览文件 @
8b87da13
...
...
@@ -47,6 +47,10 @@ export default defineConfig({
},
resolve
:
{
alias
:
[
{
find
:
'
vue
'
,
replacement
:
resolve
(
'
../uni-app-vue/dist/view.runtime.esm.js
'
),
},
{
find
:
'
@dcloudio/uni-api
'
,
replacement
:
resolve
(
'
../uni-api/src/index.ts
'
),
...
...
@@ -88,21 +92,21 @@ export default defineConfig({
lib
:
{
name
:
'
uni-app-view
'
,
fileName
:
'
uni-app-view
'
,
entry
:
path
.
resolve
(
__dirname
,
'
src/view/
components/
index.ts
'
),
entry
:
path
.
resolve
(
__dirname
,
'
src/view/index.ts
'
),
formats
:
[
'
umd
'
],
},
assetsDir
:
'
.
'
,
rollupOptions
:
{
output
:
{
globals
:
{
vue
:
'
Vue
'
,
},
},
external
(
source
)
{
if
([
'
vue
'
].
includes
(
source
))
{
return
true
}
},
//
output: {
//
globals: {
//
vue: 'Vue',
//
},
//
},
//
external(source) {
//
if (['vue'].includes(source)) {
//
return true
//
}
//
},
preserveEntrySignatures
:
'
strict
'
,
plugins
:
rollupPlugins
,
onwarn
:
(
msg
,
warn
)
=>
{
...
...
packages/uni-app-vue/build.json
浏览文件 @
8b87da13
{
"input"
:
{
"src/index.ts"
:
[
"dist/vue.runtime.esm.js"
]
[
{
"input"
:
{
"src/service/index.ts"
:
[
"dist/service.runtime.esm.js"
]
},
"output"
:
{
"banner"
:
"export default function vueFactory (exports) {
\n
"
,
"footer"
:
"}"
},
"external"
:
false
},
"output"
:
{
"banner"
:
"export default function vueFactory (exports) {
\n
"
,
"footer"
:
"}"
},
"external"
:
false
}
{
"input"
:
{
"src/view/index.ts"
:
[
"dist/view.runtime.esm.js"
]
},
"external"
:
false
}
]
packages/uni-app-vue/dist/service.runtime.esm.js
0 → 100644
浏览文件 @
8b87da13
此差异已折叠。
点击以展开。
packages/uni-app-vue/dist/view.runtime.esm.js
0 → 100644
浏览文件 @
8b87da13
此差异已折叠。
点击以展开。
packages/uni-app-vue/lib/
vu
e.runtime.esm.js
→
packages/uni-app-vue/lib/
servic
e.runtime.esm.js
浏览文件 @
8b87da13
此差异已折叠。
点击以展开。
packages/uni-app-vue/
dist/vue
.runtime.esm.js
→
packages/uni-app-vue/
lib/view
.runtime.esm.js
浏览文件 @
8b87da13
此差异已折叠。
点击以展开。
packages/uni-app-vue/src/index.ts
已删除
100644 → 0
浏览文件 @
c3742945
import
*
as
Vue
from
'
../lib/vue.runtime.esm
'
exports
.
Vue
=
Vue
packages/uni-app-vue/src/service/index.ts
0 → 100644
浏览文件 @
8b87da13
import
*
as
Vue
from
'
../../lib/service.runtime.esm
'
exports
.
Vue
=
Vue
packages/uni-app-vue/src/view/index.ts
0 → 100644
浏览文件 @
8b87da13
export
*
from
'
../../lib/view.runtime.esm
'
packages/uni-h5/src/platform/dom.ts
浏览文件 @
8b87da13
...
...
@@ -20,7 +20,7 @@ function addBase(filePath: string) {
export
function
getRealPath
(
filePath
:
string
)
{
// 相对路径模式对静态资源路径特殊处理
if
(
__uniConfig
.
router
.
base
===
'
./
'
)
{
if
(
__uniConfig
.
router
!
.
base
===
'
./
'
)
{
filePath
=
filePath
.
replace
(
/^
\.\/
static
\/
/
,
'
/static/
'
)
}
if
(
filePath
.
indexOf
(
'
/
'
)
===
0
)
{
...
...
packages/uni-h5/src/service/api/ui/requestComponentInfo.ts
浏览文件 @
8b87da13
...
...
@@ -2,27 +2,12 @@ import { ComponentPublicInstance } from 'vue'
import
{
getCustomDataset
}
from
'
@dcloudio/uni-shared
'
import
{
getWindowOffset
}
from
'
@dcloudio/uni-core
'
import
{
getContextInfo
}
from
'
@dcloudio/uni-components
'
import
{
SelectorQueryNodeInfo
,
SelectorQueryRequest
}
from
'
@dcloudio/uni-api
'
type
NodeField
=
UniApp
.
NodeField
interface
NodeInfo
extends
UniApp
.
NodeInfo
,
Omit
<
Partial
<
Record
<
keyof
CSSStyleDeclaration
,
any
>>
,
'
top
'
|
'
bottom
'
|
'
left
'
|
'
right
'
|
'
height
'
|
'
width
'
>
{
contextInfo
?:
ReturnType
<
typeof
getContextInfo
>
}
export
interface
Request
{
component
:
ComponentPublicInstance
|
undefined
|
null
selector
:
string
single
:
boolean
fields
:
NodeField
}
function
getRootInfo
(
fields
:
NodeField
)
{
const
info
:
NodeInfo
=
{}
const
info
:
SelectorQuery
NodeInfo
=
{}
if
(
fields
.
id
)
{
info
.
id
=
''
}
...
...
@@ -50,8 +35,11 @@ function getRootInfo(fields: NodeField) {
return
info
}
function
getNodeInfo
(
el
:
HTMLElement
,
fields
:
NodeField
):
NodeInfo
{
const
info
:
NodeInfo
=
{}
function
getNodeInfo
(
el
:
HTMLElement
,
fields
:
NodeField
):
SelectorQueryNodeInfo
{
const
info
:
SelectorQueryNodeInfo
=
{}
const
{
top
}
=
getWindowOffset
()
if
(
fields
.
id
)
{
info
.
id
=
el
.
id
...
...
@@ -121,7 +109,7 @@ function getNodesInfo(
selector
:
string
,
single
:
boolean
,
fields
:
NodeField
):
NodeInfo
|
NodeInfo
[]
|
null
{
):
SelectorQueryNodeInfo
|
SelectorQuery
NodeInfo
[]
|
null
{
const
parentElement
=
findElm
(
component
,
pageVm
).
parentElement
if
(
!
parentElement
)
{
return
single
?
null
:
[]
...
...
@@ -133,7 +121,7 @@ function getNodesInfo(
}
return
null
}
else
{
let
infos
:
NodeInfo
[]
=
[]
let
infos
:
SelectorQuery
NodeInfo
[]
=
[]
const
nodeList
=
parentElement
.
querySelectorAll
(
selector
)
if
(
nodeList
&&
nodeList
.
length
)
{
;[].
forEach
.
call
(
nodeList
,
(
node
)
=>
{
...
...
@@ -146,10 +134,10 @@ function getNodesInfo(
export
function
requestComponentInfo
(
page
:
ComponentPublicInstance
,
reqs
:
Array
<
Request
>
,
callback
:
(
result
:
Array
<
NodeInfo
|
null
>
)
=>
void
reqs
:
Array
<
SelectorQuery
Request
>
,
callback
:
(
result
:
Array
<
SelectorQuery
NodeInfo
|
null
>
)
=>
void
)
{
const
result
:
Array
<
NodeInfo
|
null
>
=
[]
const
result
:
Array
<
SelectorQuery
NodeInfo
|
null
>
=
[]
reqs
.
forEach
(({
component
,
selector
,
single
,
fields
})
=>
{
if
(
component
===
null
)
{
result
.
push
(
getRootInfo
(
fields
))
...
...
packages/uni-h5/tsconfig.json
0 → 100644
浏览文件 @
8b87da13
{
"extends"
:
"../../tsconfig.json"
,
"compilerOptions"
:
{
"paths"
:
{
"@dcloudio/*"
:
[
"packages/*/src"
],
"@dcloudio/uni-platform"
:
[
"packages/uni-h5/src/platform/index.ts"
]
}
}
}
packages/uni-i18n/tsconfig.json
浏览文件 @
8b87da13
...
...
@@ -12,7 +12,8 @@
"resolveJsonModule"
:
true
,
"esModuleInterop"
:
true
,
"removeComments"
:
false
,
"lib"
:
[
"ESNext"
,
"DOM"
]
"lib"
:
[
"ESNext"
,
"DOM"
],
"types"
:
[
"node"
,
"@dcloudio/types"
]
},
"include"
:
[
"src"
]
}
packages/uni-mp-alipay/dist/uni.api.esm.js
浏览文件 @
8b87da13
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
extend
}
from
'
@vue/shared
'
;
function
getBaseSystemInfo
()
{
return
my
.
getSystemInfoSync
()
}
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -200,10 +204,6 @@ function defineSyncApi(name, fn, protocol, options) {
return
wrapperSyncApi
(
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
}
function
getBaseSystemInfo
()
{
return
my
.
getSystemInfoSync
()
}
const
API_UPX2PX
=
'
upx2px
'
;
const
Upx2pxProtocol
=
[
{
...
...
packages/uni-mp-alipay/src/platform/index.ts
浏览文件 @
8b87da13
export
*
from
'
@dcloudio/uni-mp-platform
'
export
function
getBaseSystemInfo
()
{
return
my
.
getSystemInfoSync
()
}
packages/uni-mp-alipay/tsconfig.json
0 → 100644
浏览文件 @
8b87da13
{
"extends"
:
"../../tsconfig.json"
,
"compilerOptions"
:
{
"paths"
:
{
"@dcloudio/*"
:
[
"packages/*/src"
],
"@dcloudio/uni-platform"
:
[
"packages/uni-mp-alipay/src/platform/index.ts"
],
"@dcloudio/uni-mp-polyfill"
:
[
"packages/uni-mp-core/src/runtime/polyfill"
]
}
}
}
packages/uni-mp-baidu/dist/uni.api.esm.js
浏览文件 @
8b87da13
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
extend
}
from
'
@vue/shared
'
;
function
getBaseSystemInfo
()
{
return
swan
.
getSystemInfoSync
()
}
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -200,10 +204,6 @@ function defineSyncApi(name, fn, protocol, options) {
return
wrapperSyncApi
(
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
}
function
getBaseSystemInfo
()
{
return
swan
.
getSystemInfoSync
()
}
const
API_UPX2PX
=
'
upx2px
'
;
const
Upx2pxProtocol
=
[
{
...
...
packages/uni-mp-baidu/src/platform/index.ts
浏览文件 @
8b87da13
export
*
from
'
@dcloudio/uni-mp-platform
'
export
function
getBaseSystemInfo
()
{
return
swan
.
getSystemInfoSync
()
}
packages/uni-mp-baidu/tsconfig.json
0 → 100644
浏览文件 @
8b87da13
{
"extends"
:
"../../tsconfig.json"
,
"compilerOptions"
:
{
"paths"
:
{
"@dcloudio/*"
:
[
"packages/*/src"
],
"@dcloudio/uni-platform"
:
[
"packages/uni-mp-baidu/src/platform/index.ts"
],
"@dcloudio/uni-mp-polyfill"
:
[
"packages/uni-mp-core/src/runtime/polyfill"
]
}
}
}
packages/uni-mp-core/src/api/index.ts
浏览文件 @
8b87da13
import
{
hasOwn
}
from
'
@vue/shared
'
import
{
upx2px
,
addInterceptor
,
removeInterceptor
}
from
'
@dcloudio/uni-api
'
import
{
upx2px
}
from
'
@dcloudio/uni-api/src/service/base/upx2px
'
import
{
addInterceptor
,
removeInterceptor
,
}
from
'
@dcloudio/uni-api/src/service/base/interceptor
'
import
{
promisify
}
from
'
./promise
'
import
{
initWrapper
}
from
'
./wrapper
'
...
...
packages/uni-mp-core/src/api/promise.ts
浏览文件 @
8b87da13
import
{
extend
,
isFunction
}
from
'
@vue/shared
'
import
{
invokeApi
,
handlePromise
,
wrapperReturnValue
}
from
'
@dcloudio/uni-api
'
import
{
handlePromise
}
from
'
@dcloudio/uni-api/src/helpers/api/promise
'
import
{
invokeApi
,
wrapperReturnValue
,
}
from
'
@dcloudio/uni-api/src/helpers/interceptor
'
const
SYNC_API_RE
=
/^
\$
|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
...
...
packages/uni-mp-core/src/platform/index.ts
已删除
100644 → 0
浏览文件 @
c3742945
export
function
getRealPath
()
{}
export
function
operateVideoPlayer
()
{}
export
function
operateMap
()
{}
export
function
requestComponentInfo
()
{}
export
function
addIntersectionObserver
()
{}
export
function
removeIntersectionObserver
()
{}
export
function
addMediaQueryObserver
()
{}
export
function
removeMediaQueryObserver
()
{}
export
function
saveImage
()
{}
export
function
getSameOriginUrl
()
{}
export
const
TEMP_PATH
=
''
packages/uni-mp-qq/dist/uni.api.esm.js
浏览文件 @
8b87da13
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
extend
}
from
'
@vue/shared
'
;
function
getBaseSystemInfo
()
{
return
qq
.
getSystemInfoSync
()
}
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -200,10 +204,6 @@ function defineSyncApi(name, fn, protocol, options) {
return
wrapperSyncApi
(
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
}
function
getBaseSystemInfo
()
{
return
qq
.
getSystemInfoSync
()
}
const
API_UPX2PX
=
'
upx2px
'
;
const
Upx2pxProtocol
=
[
{
...
...
packages/uni-mp-qq/src/platform/index.ts
浏览文件 @
8b87da13
export
*
from
'
@dcloudio/uni-mp-platform
'
export
function
getBaseSystemInfo
()
{
return
qq
.
getSystemInfoSync
()
}
packages/uni-mp-qq/tsconfig.json
0 → 100644
浏览文件 @
8b87da13
{
"extends"
:
"../../tsconfig.json"
,
"compilerOptions"
:
{
"paths"
:
{
"@dcloudio/*"
:
[
"packages/*/src"
],
"@dcloudio/uni-platform"
:
[
"packages/uni-mp-qq/src/platform/index.ts"
],
"@dcloudio/uni-mp-polyfill"
:
[
"packages/uni-mp-core/src/runtime/polyfill"
]
}
}
}
packages/uni-mp-toutiao/dist/uni.api.esm.js
浏览文件 @
8b87da13
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
extend
}
from
'
@vue/shared
'
;
function
getBaseSystemInfo
()
{
return
tt
.
getSystemInfoSync
()
}
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -200,10 +204,6 @@ function defineSyncApi(name, fn, protocol, options) {
return
wrapperSyncApi
(
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
}
function
getBaseSystemInfo
()
{
return
tt
.
getSystemInfoSync
()
}
const
API_UPX2PX
=
'
upx2px
'
;
const
Upx2pxProtocol
=
[
{
...
...
packages/uni-mp-toutiao/src/platform/index.ts
浏览文件 @
8b87da13
export
*
from
'
@dcloudio/uni-mp-platform
'
export
function
getBaseSystemInfo
()
{
return
tt
.
getSystemInfoSync
()
}
packages/uni-mp-toutiao/tsconfig.json
0 → 100644
浏览文件 @
8b87da13
{
"extends"
:
"../../tsconfig.json"
,
"compilerOptions"
:
{
"paths"
:
{
"@dcloudio/*"
:
[
"packages/*/src"
],
"@dcloudio/uni-platform"
:
[
"packages/uni-mp-toutiao/src/platform/index.ts"
],
"@dcloudio/uni-mp-polyfill"
:
[
"packages/uni-mp-core/src/runtime/polyfill"
]
}
}
}
packages/uni-mp-weixin/dist/uni.api.esm.js
浏览文件 @
8b87da13
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
extend
}
from
'
@vue/shared
'
;
function
getBaseSystemInfo
()
{
return
wx
.
getSystemInfoSync
()
}
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -200,10 +204,6 @@ function defineSyncApi(name, fn, protocol, options) {
return
wrapperSyncApi
(
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
}
function
getBaseSystemInfo
()
{
return
wx
.
getSystemInfoSync
()
}
const
API_UPX2PX
=
'
upx2px
'
;
const
Upx2pxProtocol
=
[
{
...
...
packages/uni-mp-weixin/src/platform/index.ts
浏览文件 @
8b87da13
export
*
from
'
@dcloudio/uni-mp-platform
'
export
function
getBaseSystemInfo
()
{
return
wx
.
getSystemInfoSync
()
}
packages/uni-mp-weixin/tsconfig.json
0 → 100644
浏览文件 @
8b87da13
{
"extends"
:
"../../tsconfig.json"
,
"compilerOptions"
:
{
"paths"
:
{
"@dcloudio/*"
:
[
"packages/*/src"
],
"@dcloudio/uni-platform"
:
[
"packages/uni-mp-weixin/src/platform/index.ts"
],
"@dcloudio/uni-mp-polyfill"
:
[
"packages/uni-mp-core/src/runtime/polyfill"
]
}
}
}
packages/uni-quickapp-webview/dist/uni.api.esm.js
浏览文件 @
8b87da13
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
extend
}
from
'
@vue/shared
'
;
function
getBaseSystemInfo
()
{
return
qa
.
getSystemInfoSync
()
}
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -200,10 +204,6 @@ function defineSyncApi(name, fn, protocol, options) {
return
wrapperSyncApi
(
name
,
fn
,
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
protocol
:
undefined
,
options
);
}
function
getBaseSystemInfo
()
{
return
qa
.
getSystemInfoSync
()
}
const
API_UPX2PX
=
'
upx2px
'
;
const
Upx2pxProtocol
=
[
{
...
...
packages/uni-quickapp-webview/src/platform/index.ts
浏览文件 @
8b87da13
export
*
from
'
@dcloudio/uni-mp-platform
'
export
function
getBaseSystemInfo
()
{
return
qa
.
getSystemInfoSync
()
}
packages/uni-quickapp-webview/tsconfig.json
0 → 100644
浏览文件 @
8b87da13
{
"extends"
:
"../../tsconfig.json"
,
"compilerOptions"
:
{
"paths"
:
{
"@dcloudio/*"
:
[
"packages/*/src"
],
"@dcloudio/uni-platform"
:
[
"packages/uni-quickapp-webview/src/platform/index.ts"
],
"@dcloudio/uni-mp-polyfill"
:
[
"packages/uni-mp-core/src/runtime/polyfill"
]
}
}
}
packages/uni-shared/tsconfig.json
浏览文件 @
8b87da13
...
...
@@ -2,6 +2,8 @@
"compilerOptions"
:
{
"outDir"
:
"dist"
,
"sourceMap"
:
false
,
"declaration"
:
true
,
"declarationDir"
:
"./dist/packages/uni-shared/src"
,
"target"
:
"esnext"
,
"module"
:
"esnext"
,
"moduleResolution"
:
"node"
,
...
...
packages/vite-plugin-uni/package.json
浏览文件 @
8b87da13
...
...
@@ -41,7 +41,7 @@
"@types/sass"
:
"^1.16.0"
},
"uni-app"
:
{
"compilerVersion"
:
"3.1.2"
"compilerVersion"
:
"3.1.2
1
"
},
"gitHead"
:
"56deaeb47d42e924d10282d7af418ccee6b139bf"
}
rollup.config.js
浏览文件 @
8b87da13
import
fs
from
'
fs
'
import
path
from
'
path
'
import
ts
from
'
rollup-plugin-typescript2
'
import
replace
from
'
@rollup/plugin-replace
'
...
...
@@ -19,7 +20,8 @@ const pkg = require(resolve(`package.json`))
let
hasTSChecked
=
false
const
configs
=
[]
const
buildOptions
=
require
(
resolve
(
`build.json`
))
let
buildOptions
=
require
(
resolve
(
`build.json`
))
function
normalizeOutput
(
file
,
output
=
{})
{
return
Object
.
assign
(
...
...
@@ -32,40 +34,64 @@ function normalizeOutput(file, output = {}) {
)
}
Object
.
keys
(
buildOptions
.
input
).
forEach
((
name
)
=>
{
const
files
=
buildOptions
.
input
[
name
]
if
(
Array
.
isArray
(
files
))
{
files
.
forEach
((
file
)
=>
{
if
(
!
Array
.
isArray
(
buildOptions
))
{
buildOptions
=
[
buildOptions
]
}
buildOptions
.
forEach
((
buildOption
)
=>
{
Object
.
keys
(
buildOption
.
input
).
forEach
((
name
)
=>
{
const
files
=
buildOption
.
input
[
name
]
if
(
Array
.
isArray
(
files
))
{
files
.
forEach
((
file
)
=>
{
configs
.
push
(
createConfig
(
name
,
normalizeOutput
(
resolve
(
file
),
buildOption
.
output
),
buildOption
)
)
})
}
else
{
configs
.
push
(
createConfig
(
name
,
normalizeOutput
(
resolve
(
file
),
buildOptions
.
output
))
)
})
}
else
{
configs
.
push
(
createConfig
(
name
,
normalizeOutput
(
resolve
(
buildOptions
.
input
[
name
]),
buildOptions
.
output
)
createConfig
(
name
,
normalizeOutput
(
resolve
(
buildOption
.
input
[
name
]),
buildOption
.
output
),
buildOption
)
)
)
}
}
}
)
})
export
default
configs
function
createConfig
(
entryFile
,
output
,
plugins
=
[])
{
function
resolveTsconfigJson
()
{
const
tsconfigJsonPath
=
resolve
(
'
tsconfig.json
'
)
if
(
fs
.
existsSync
(
tsconfigJsonPath
)
// &&
// require(tsconfigJsonPath).extends === '../../tsconfig.json'
)
{
return
tsconfigJsonPath
}
return
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
)
}
function
createConfig
(
entryFile
,
output
,
buildOption
)
{
const
shouldEmitDeclarations
=
process
.
env
.
TYPES
!=
null
&&
!
hasTSChecked
const
tsPlugin
=
ts
({
check
:
!
process
.
env
.
CI
&&
process
.
env
.
NODE_ENV
===
'
production
'
&&
!
hasTSChecked
,
tsconfig
:
path
.
resolve
(
__dirname
,
'
tsconfig.json
'
),
tsconfig
:
resolveTsconfigJson
(
),
cacheRoot
:
path
.
resolve
(
__dirname
,
'
node_modules/.rts2_cache
'
),
tsconfigOverride
:
{
compilerOptions
:
{
sourceMap
:
output
.
sourcemap
,
declaration
:
shouldEmitDeclarations
,
declarationMap
:
shouldEmitDeclarations
,
declarationMap
:
false
,
},
exclude
:
[
'
**/__tests__
'
,
'
test-dts
'
],
},
useTsconfigDeclarationDir
:
true
,
})
// we only need to check TS and generate declarations once for each build.
...
...
@@ -74,29 +100,28 @@ function createConfig(entryFile, output, plugins = []) {
hasTSChecked
=
true
const
external
=
buildOption
s
.
external
===
false
buildOption
.
external
===
false
?
[]
:
[
'
vue
'
,
'
@vue/shared
'
,
...
Object
.
keys
(
pkg
.
dependencies
||
{}),
...
Object
.
keys
(
pkg
.
peerDependencies
||
{}),
...(
buildOption
s
.
external
||
[]),
...(
buildOption
.
external
||
[]),
]
return
{
input
:
resolve
(
entryFile
),
external
,
plugins
:
[
createAliasPlugin
(
buildOption
s
),
createAliasPlugin
(
buildOption
),
nodeResolve
(),
commonjs
(),
json
({
namedExports
:
false
,
}),
tsPlugin
,
createReplacePlugin
(
buildOptions
,
output
.
format
),
...
plugins
,
createReplacePlugin
(
buildOption
,
output
.
format
),
],
output
,
onwarn
:
(
msg
,
warn
)
=>
{
...
...
@@ -105,7 +130,7 @@ function createConfig(entryFile, output, plugins = []) {
// }
},
treeshake
:
buildOption
s
.
treeshake
===
false
buildOption
.
treeshake
===
false
?
false
:
{
moduleSideEffects
(
id
)
{
...
...
@@ -119,11 +144,11 @@ function createConfig(entryFile, output, plugins = []) {
}
}
function
createAliasPlugin
(
buildOption
s
)
{
return
alias
(
buildOption
s
.
alias
||
{})
function
createAliasPlugin
(
buildOption
)
{
return
alias
(
buildOption
.
alias
||
{})
}
function
createReplacePlugin
(
buildOption
s
,
format
)
{
function
createReplacePlugin
(
buildOption
,
format
)
{
const
replacements
=
{
global
:
format
===
'
cjs
'
?
'
global
'
:
'
window
'
,
__DEV__
:
`(process.env.NODE_ENV !== 'production')`
,
...
...
@@ -131,8 +156,8 @@ function createReplacePlugin(buildOptions, format) {
__PLATFORM__
:
JSON
.
stringify
(
'
h5
'
),
__NODE_JS__
:
format
===
'
cjs
'
,
}
if
(
buildOption
s
.
replacements
)
{
Object
.
assign
(
replacements
,
buildOption
s
.
replacements
)
if
(
buildOption
.
replacements
)
{
Object
.
assign
(
replacements
,
buildOption
.
replacements
)
}
Object
.
keys
(
replacements
).
forEach
((
key
)
=>
{
...
...
tsconfig.json
浏览文件 @
8b87da13
...
...
@@ -28,13 +28,7 @@
"rootDir"
:
"."
,
"paths"
:
{
"@dcloudio/*"
:
[
"packages/*/src"
],
"@dcloudio/uni-mp-polyfill"
:
[
"packages/uni-mp-core/src/runtime/polyfill"
],
"@dcloudio/uni-platform"
:
[
"packages/uni-h5/src/platform/index.ts"
],
"@dcloudio/uni-mp-platform"
:
[
"packages/uni-mp-core/src/platform/index.ts"
]
"@dcloudio/uni-platform"
:
[
"packages/uni-h5/src/platform/index.ts"
]
}
},
"include"
:
[
...
...
yarn.lock
浏览文件 @
8b87da13
...
...
@@ -359,8 +359,8 @@
"@dcloudio/types@^2.2.15":
version "2.2.15"
resolved "https://registry.
nlark.com/@dcloudio/types/download/@dcloudio/types-2.2.15.tgz?cache=0&sync_timestamp=1624605648994&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40dcloudio%2Ftypes%2Fdownload%2F%40dcloudio%2F
types-2.2.15.tgz#8e0cec74ba7880816a57d9c3315f18a4e6fc79ed"
integrity sha
1-jgzsdLp4gIFqV9nDMV8YpOb8ee0
=
resolved "https://registry.
yarnpkg.com/@dcloudio/types/-/
types-2.2.15.tgz#8e0cec74ba7880816a57d9c3315f18a4e6fc79ed"
integrity sha
512-o0V2cyCDoFKpog380FJ1U7lPo3JGg1L8DOL6m60Z8H0+ufA1S/fzUp5gJYX6YwjJawV1F/TW9L8VfDSxVyC4TA=
=
"@eslint/eslintrc@^0.4.2":
version "0.4.2"
...
...
@@ -1404,10 +1404,10 @@
"@octokit/types" "^6.0.3"
universal-user-agent "^6.0.0"
"@octokit/openapi-types@^7.3.
3
":
version "7.3.
3
"
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-7.3.
3.tgz#a7ab7bd16cea040b836521a5afaf08fa36085e5f
"
integrity sha512-
/tpvcWCjYUHtvdc/t/bX6pxaOoeYPhfPCyvUaSWP29YkRcdZmlhRaMsXudZhvXm8GBPBxmCOsf1Ye/FpkszOHw
==
"@octokit/openapi-types@^7.3.
4
":
version "7.3.
4
"
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-7.3.
4.tgz#9f075e263d1d3c1ba7a789e0085a5ed75d6daad1
"
integrity sha512-
binmLrMQWBG0CvUE/jS3/XXrZbX3oN/6gF7ocSsb/ZJ0xfox2isJN4ZhGeL91SDJVzFK7XuUYBm2mlIDedkxsg
==
"@octokit/plugin-enterprise-rest@^6.0.1":
version "6.0.1"
...
...
@@ -1426,12 +1426,12 @@
resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85"
integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==
"@octokit/plugin-rest-endpoint-methods@5.3.
2
":
version "5.3.
2
"
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.3.
2.tgz#4426a06aca230df17e40a332dcbc348779d9956
9"
integrity sha512-
vwsdLUC4TUohbHAqD0f/BjUw/kfKmNs1f0+Fkldzr7GKqMXjNku5U0jzZCmVUI6GcH7b/KcXd9WtbpVpofDehQ
==
"@octokit/plugin-rest-endpoint-methods@5.3.
3
":
version "5.3.
3
"
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.3.
3.tgz#b447ed80126d36a9cf99daabb055bf0c157c8d8
9"
integrity sha512-
xHlZK9gxVFP2YQYXOmR1ItCwl9k+0Z3cA40oGMQfpPbWIYY32FTM15Qj+V0V6oLJZr0E26Sz3VX6qYlM/ytfig
==
dependencies:
"@octokit/types" "^6.16.
5
"
"@octokit/types" "^6.16.
6
"
deprecation "^2.3.1"
"@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0":
...
...
@@ -1456,21 +1456,21 @@
universal-user-agent "^6.0.0"
"@octokit/rest@^18.1.0":
version "18.6.
1
"
resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.6.
1.tgz#82f0582fd7e1a6e2da3cee0a8e30c2647e242cb3
"
integrity sha512-
4NUr0sr8ZohvYoDVDT/P7lmamzeGrFjdfVxIuxW9Nz3xMp//MBmIKYxHhzMuMWGa8MHs69VT2HKsNYRJMCYyW
A==
version "18.6.
2
"
resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.6.
2.tgz#181ef6a23f1e5977569f439bd256041dc9d5a696
"
integrity sha512-
q6nrxhM+oXzPmbZlykNaBP1vG0+mU6URLBy9cl4XXrWcD0k0ShYiaXDaPewbllTxoMevqv+OABb+Q7ycUWkE2
A==
dependencies:
"@octokit/core" "^3.5.0"
"@octokit/plugin-paginate-rest" "^2.6.2"
"@octokit/plugin-request-log" "^1.0.2"
"@octokit/plugin-rest-endpoint-methods" "5.3.
2
"
"@octokit/plugin-rest-endpoint-methods" "5.3.
3
"
"@octokit/types@^6.0.3", "@octokit/types@^6.13.0", "@octokit/types@^6.16.1", "@octokit/types@^6.16.
5
":
version "6.16.
5
"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.16.
5.tgz#75f03ed0b48565fc7afb0e5ebd658e802ed0b7c1
"
integrity sha512-
2v30UzgezzVZNCZlEryr8ujqaFW0EEH0fyuNxz5QdE3rlkCG2SXz8RTCT1V4q7inEI2kd2xTcROlq9OkEvY0TQ
==
"@octokit/types@^6.0.3", "@octokit/types@^6.13.0", "@octokit/types@^6.16.1", "@octokit/types@^6.16.
6
":
version "6.16.
6
"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.16.
6.tgz#c113a0408a799ccb93c8749806733ad5d3edd142
"
integrity sha512-
PrEGjMnEhLlNttsuLadEWqXdMYJX3icHHaRs/ChJebRT79VDh/cNkk8bURx05BEEwr7QvaLsRzjt3hNxUJZfXA
==
dependencies:
"@octokit/openapi-types" "^7.3.
3
"
"@octokit/openapi-types" "^7.3.
4
"
"@rollup/plugin-alias@^3.1.1":
version "3.1.2"
...
...
@@ -2054,6 +2054,11 @@
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.1.2.tgz#1069c0bc7d6f4bd15ccf3a5f3be29450aca368f9"
integrity sha512-EmH/poaDWBPJaPILXNI/1fvUbArJQmmTyVCwvvyDYDFnkPoTclAbHRAtyIvqfez7jybTDn077HTNILpxlsoWhg==
"@webcomponents/custom-elements@^1.4.3":
version "1.4.3"
resolved "https://registry.yarnpkg.com/@webcomponents/custom-elements/-/custom-elements-1.4.3.tgz#1800d49f38bb4425ebfd160b50115e62776109d7"
integrity sha512-iD0YW46SreUQANGccywK/eC+gZELNHocZZrY2fGwrIlx/biQOTkAF9IohisibHbrmIHmA9pVCIdGwzfO+W0gig==
JSONStream@^1.0.4:
version "1.3.5"
resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0"
...
...
@@ -3578,9 +3583,9 @@ ee-first@1.1.1:
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
electron-to-chromium@^1.3.723:
version "1.3.75
6
"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.75
6.tgz#942cee59cd64d19f576d8d5804eef09cb423740c
"
integrity sha512-
WsmJym1TMeHVndjPjczTFbnRR/c4sbzg8fBFtuhlb2Sru3i/S1VGpzDSrv/It8ctMU2bj8G7g7/O3FzYMGw6eA
==
version "1.3.75
7
"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.75
7.tgz#ff99436c99ca0fc5d120e11030a868401396e0e1
"
integrity sha512-
kP0ooyrvavDC+Y9UG6G/pUVxfRNM2VTJwtLQLvgsJeyf1V+7shMCb68Wj0/TETmfx8dWv9pToGkVT39udE87wQ
==
elliptic@^6.5.3:
version "6.5.4"
...
...
@@ -7327,9 +7332,9 @@ parse-path@^4.0.0:
query-string "^6.13.8"
parse-url@^5.0.0:
version "5.0.
5
"
resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-5.0.
5.tgz#06b7f6978b65cac7851bb768bec4e0b950714e1a
"
integrity sha512-
AwfVhXaQrNNI6UPUJq/GJN2qoY0L9gPgxhh9VbDP0bfBAJWaC/Zh8hjQ58YKTi4AagOT70fpadkYSKPo+eFb1w
==
version "5.0.
6
"
resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-5.0.
6.tgz#9bc508b11f8844e0b8cd9b43ac511852a4e24ec3
"
integrity sha512-
nZp+U7NFVTsBXTh6oGxdwvd7ncz3hJCl74q0lC0pLc3ypXJMKFUpfUEAd4r1x8zVVF5UHFik+CBNOQKN0ayByA
==
dependencies:
is-ssh "^1.3.0"
normalize-url "4.5.0"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录