Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
53d896ef
U
uni-app
项目概览
陈庄旺
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
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,发现更多精彩内容 >>
提交
53d896ef
编写于
8月 17, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(app): sourcemap
上级
1ab6b776
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
66 addition
and
25 deletion
+66
-25
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+1
-0
packages/uni-app-plus/src/service/api/ad/interactiveAd.ts
packages/uni-app-plus/src/service/api/ad/interactiveAd.ts
+1
-1
packages/uni-app-plus/src/service/api/base/index.ts
packages/uni-app-plus/src/service/api/base/index.ts
+0
-1
packages/uni-app-plus/src/service/api/base/requireNativePlugin.ts
.../uni-app-plus/src/service/api/base/requireNativePlugin.ts
+0
-11
packages/uni-app-plus/src/service/api/device/clipboard.ts
packages/uni-app-plus/src/service/api/device/clipboard.ts
+1
-1
packages/uni-app-plus/src/service/api/device/soterAuthentication.ts
...ni-app-plus/src/service/api/device/soterAuthentication.ts
+2
-1
packages/uni-app-plus/src/service/api/network/request.ts
packages/uni-app-plus/src/service/api/network/request.ts
+1
-1
packages/uni-app-plus/src/service/api/network/socket.ts
packages/uni-app-plus/src/service/api/network/socket.ts
+1
-1
packages/uni-app-plus/src/service/api/plugin/requireNativePlugin.ts
...ni-app-plus/src/service/api/plugin/requireNativePlugin.ts
+10
-2
packages/uni-app-plus/src/service/api/ui/subNVue.ts
packages/uni-app-plus/src/service/api/ui/subNVue.ts
+1
-1
packages/uni-app-vite/src/plugin/build.ts
packages/uni-app-vite/src/plugin/build.ts
+16
-2
packages/uni-cli-shared/src/hbx/env.ts
packages/uni-cli-shared/src/hbx/env.ts
+26
-0
packages/uni-cli-shared/src/vite/plugins/cssScoped.ts
packages/uni-cli-shared/src/vite/plugins/cssScoped.ts
+1
-1
packages/vite-plugin-uni/src/cli/utils.ts
packages/vite-plugin-uni/src/cli/utils.ts
+4
-1
packages/vite-plugin-uni/src/configResolved/plugins/easycom.ts
...ges/vite-plugin-uni/src/configResolved/plugins/easycom.ts
+1
-1
未找到文件。
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
53d896ef
...
...
@@ -12122,6 +12122,7 @@ var serviceContext = (function (vue) {
share: share,
shareWithSystem: shareWithSystem,
requestPayment: requestPayment,
requireNativePlugin: requireNativePlugin,
__vuePlugin: index$1,
restoreGlobal: restoreGlobal,
createRewardedVideoAd: createRewardedVideoAd,
...
...
packages/uni-app-plus/src/service/api/ad/interactiveAd.ts
浏览文件 @
53d896ef
...
...
@@ -6,7 +6,7 @@ import {
CreateInteractiveAdProtocol
,
}
from
'
@dcloudio/uni-api
'
import
{
requireNativePlugin
}
from
'
../
base
'
import
{
requireNativePlugin
}
from
'
../
plugin/requireNativePlugin
'
import
{
AdEventHandler
,
EventType
}
from
'
./adBase
'
...
...
packages/uni-app-plus/src/service/api/base/index.ts
已删除
100644 → 0
浏览文件 @
1ab6b776
export
*
from
'
./requireNativePlugin
'
packages/uni-app-plus/src/service/api/base/requireNativePlugin.ts
已删除
100644 → 0
浏览文件 @
1ab6b776
declare
const
weex
:
any
declare
const
__requireNativePlugin__
:
any
export
function
requireNativePlugin
(
pluginName
:
string
)
{
/* eslint-disable no-undef */
if
(
typeof
weex
!==
'
undefined
'
)
{
return
weex
.
requireModule
(
pluginName
)
}
/* eslint-disable no-undef */
return
__requireNativePlugin__
(
pluginName
)
}
packages/uni-app-plus/src/service/api/device/clipboard.ts
浏览文件 @
53d896ef
...
...
@@ -5,7 +5,7 @@ import {
API_TYPE_SET_CLIPBOARD_DATA
,
defineAsyncApi
,
}
from
'
@dcloudio/uni-api
'
import
{
requireNativePlugin
}
from
'
../
base
'
import
{
requireNativePlugin
}
from
'
../
plugin/requireNativePlugin
'
export
const
getClipboardData
=
defineAsyncApi
<
API_TYPE_GET_CLIPBOARD_DATA
>
(
API_GET_CLIPBOARD_DATA
,
...
...
packages/uni-app-plus/src/service/api/device/soterAuthentication.ts
浏览文件 @
53d896ef
import
{
extend
}
from
'
@vue/shared
'
import
{
requireNativePlugin
}
from
'
../../api/base/requireNativePlugin
'
import
{
useI18n
,
initI18nStartSoterAuthenticationMsgsOnce
,
...
...
@@ -19,6 +18,8 @@ import {
StartSoterAuthenticationProtocols
,
}
from
'
@dcloudio/uni-api
'
import
{
requireNativePlugin
}
from
'
../plugin/requireNativePlugin
'
function
checkIsSupportFaceID
()
{
const
platform
=
plus
.
os
.
name
!
.
toLowerCase
()
if
(
platform
!==
'
ios
'
)
{
...
...
packages/uni-app-plus/src/service/api/network/request.ts
浏览文件 @
53d896ef
...
...
@@ -6,8 +6,8 @@ import {
RequestOptions
,
RequestProtocol
,
}
from
'
@dcloudio/uni-api
'
import
{
requireNativePlugin
}
from
'
../base
'
import
{
base64ToArrayBuffer
}
from
'
@dcloudio/uni-api
'
import
{
requireNativePlugin
}
from
'
../plugin/requireNativePlugin
'
type
Type
=
'
base64
'
|
'
text
'
type
Headers
=
Record
<
string
,
string
>
...
...
packages/uni-app-plus/src/service/api/network/socket.ts
浏览文件 @
53d896ef
...
...
@@ -13,7 +13,7 @@ import {
API_TYPE_CLOSE_SOCKET
,
CloseSocketProtocol
,
}
from
'
@dcloudio/uni-api
'
import
{
requireNativePlugin
}
from
'
../
base
'
import
{
requireNativePlugin
}
from
'
../
plugin/requireNativePlugin
'
import
{
base64ToArrayBuffer
,
arrayBufferToBase64
}
from
'
@dcloudio/uni-api
'
import
{
extend
,
capitalize
}
from
'
@vue/shared
'
import
{
callOptions
}
from
'
@dcloudio/uni-shared
'
...
...
packages/uni-app-plus/src/service/api/plugin/requireNativePlugin.ts
浏览文件 @
53d896ef
export
function
requireNativePlugin
(
name
:
string
)
{
return
weex
.
requireModule
(
name
)
declare
const
weex
:
any
declare
const
__requireNativePlugin__
:
any
export
function
requireNativePlugin
(
pluginName
:
string
)
{
/* eslint-disable no-undef */
if
(
typeof
weex
!==
'
undefined
'
)
{
return
weex
.
requireModule
(
pluginName
)
}
/* eslint-disable no-undef */
return
__requireNativePlugin__
(
pluginName
)
}
packages/uni-app-plus/src/service/api/ui/subNVue.ts
浏览文件 @
53d896ef
import
{
APP_SERVICE_ID
}
from
'
../.../../../../constants
'
import
{
requireNativePlugin
}
from
'
../
base
/requireNativePlugin
'
import
{
requireNativePlugin
}
from
'
../
plugin
/requireNativePlugin
'
import
{
PlusWebviewWebviewObjectWithExtras
}
from
'
../../framework/webview/init/subNVues
'
const
EVENT_TYPE_NAME
=
'
UniAppSubNVue
'
...
...
packages/uni-app-vite/src/plugin/build.ts
浏览文件 @
53d896ef
...
...
@@ -9,9 +9,11 @@ import {
}
from
'
@dcloudio/uni-cli-shared
'
export
function
buildOptions
():
UserConfig
[
'
build
'
]
{
const
inputDir
=
process
.
env
.
UNI_INPUT_DIR
const
outputDir
=
process
.
env
.
UNI_OUTPUT_DIR
// 开始编译时,清空输出目录
if
(
fs
.
existsSync
(
process
.
env
.
UNI_OUTPUT_DIR
))
{
emptyDir
(
process
.
env
.
UNI_OUTPUT_DIR
)
if
(
fs
.
existsSync
(
outputDir
))
{
emptyDir
(
outputDir
)
}
return
{
// sourcemap: 'inline',
...
...
@@ -24,6 +26,18 @@ export function buildOptions(): UserConfig['build'] {
name
:
'
AppService
'
,
format
:
process
.
env
.
UNI_APP_CODE_SPLITING
?
'
amd
'
:
'
iife
'
,
entryFileNames
:
'
app-service.js
'
,
sourcemapPathTransform
(
relativeSourcePath
,
sourcemapPath
)
{
const
sourcePath
=
normalizePath
(
path
.
relative
(
inputDir
,
path
.
resolve
(
path
.
dirname
(
sourcemapPath
),
relativeSourcePath
)
)
)
if
(
sourcePath
.
startsWith
(
'
..
'
))
{
return
''
}
return
'
uni-app:///
'
+
sourcePath
},
manualChunks
:
{},
chunkFileNames
(
chunk
)
{
if
(
chunk
.
isDynamicEntry
&&
chunk
.
facadeModuleId
)
{
...
...
packages/uni-cli-shared/src/hbx/env.ts
浏览文件 @
53d896ef
import
path
from
'
path
'
import
BuiltinModule
from
'
module
'
import
{
once
}
from
'
@dcloudio/uni-shared
'
export
const
isInHBuilderX
=
once
(()
=>
{
...
...
@@ -17,3 +18,28 @@ export const isInHBuilderX = once(() => {
export
const
runByHBuilderX
=
once
(()
=>
{
return
!!
process
.
env
.
UNI_HBUILDERX_PLUGINS
})
/**
* 增加 node_modules
*/
export
function
initModulePaths
()
{
if
(
!
isInHBuilderX
())
{
return
}
const
Module
=
module
.
constructor
.
length
>
1
?
module
.
constructor
:
BuiltinModule
const
nodeModulesPath
=
path
.
resolve
(
process
.
env
.
UNI_CLI_CONTEXT
,
'
node_modules
'
)
const
oldNodeModulePaths
=
(
Module
as
any
).
_nodeModulePaths
;(
Module
as
any
).
_nodeModulePaths
=
function
(
from
:
string
)
{
const
paths
=
oldNodeModulePaths
.
call
(
this
,
from
)
as
string
[]
if
(
!
paths
.
includes
(
nodeModulesPath
))
{
paths
.
push
(
nodeModulesPath
)
}
return
paths
}
}
packages/uni-cli-shared/src/vite/plugins/cssScoped.ts
浏览文件 @
53d896ef
...
...
@@ -43,7 +43,7 @@ export function uniCssScopedPlugin(
debugScoped
(
id
)
return
{
code
:
addScoped
(
code
),
map
:
this
.
getCombinedSourcemap
()
,
map
:
null
,
}
}
},
...
...
packages/vite-plugin-uni/src/cli/utils.ts
浏览文件 @
53d896ef
...
...
@@ -2,7 +2,7 @@ import fs from 'fs'
import
path
from
'
path
'
import
{
BuildOptions
,
InlineConfig
}
from
'
vite
'
import
{
M
,
isInHBuilderX
}
from
'
@dcloudio/uni-cli-shared
'
import
{
M
,
isInHBuilderX
,
initModulePaths
}
from
'
@dcloudio/uni-cli-shared
'
import
{
CliOptions
}
from
'
.
'
import
{
initNVueEnv
}
from
'
./nvue
'
...
...
@@ -107,6 +107,9 @@ export function initEnv(type: 'dev' | 'build', options: CliOptions) {
:
''
)
)
}
initModulePaths
()
console
.
log
(
M
[
'
compiling
'
])
}
...
...
packages/vite-plugin-uni/src/configResolved/plugins/easycom.ts
浏览文件 @
53d896ef
...
...
@@ -120,7 +120,7 @@ export function uniEasycomPlugin(
}
return
{
code
,
map
:
this
.
getCombinedSourcemap
()
,
map
:
null
,
}
},
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录