提交 fec08800 编写于 作者: fxy060608's avatar fxy060608

fix(x-ios): 修复 错误日志sourcemap解析

上级 98bbbde1
......@@ -75,6 +75,7 @@ export function uniAppIOSPlugin(): UniVitePlugin {
process.env.UNI_APP_X_CACHE_DIR
? path.resolve(
process.env.UNI_APP_X_CACHE_DIR,
'sourcemap',
APP_SERVICE_FILENAME_MAP
)
: path.resolve(
......
......@@ -62,7 +62,11 @@ export { parseInjectModules, parseExtApiProviders } from './utils'
export * from './sourceMap'
export { parseUTSKotlinRuntimeStacktrace } from './stacktrace'
export {
parseUTSRuntimeStacktrace,
parseUTSKotlinRuntimeStacktrace,
parseUTSJavaScriptRuntimeStacktrace,
} from './stacktrace'
export { compile as toKotlin } from './kotlin'
export { compile as toSwift } from './swift'
......
import { relative } from '../utils'
import {
type GenerateJavaScriptRuntimeCodeFrameOptions,
parseUTSJavaScriptRuntimeStacktrace,
} from './js'
import {
type GenerateKotlinRuntimeCodeFrameOptions,
parseUTSKotlinRuntimeStacktrace,
} from './kotlin'
export { parseUTSSwiftPluginStacktrace } from './swift'
......@@ -7,6 +15,21 @@ export {
parseUTSKotlinRuntimeStacktrace,
} from './kotlin'
export { parseUTSJavaScriptRuntimeStacktrace } from './js'
export function parseUTSRuntimeStacktrace(
stacktrace: string,
options:
| GenerateKotlinRuntimeCodeFrameOptions
| GenerateJavaScriptRuntimeCodeFrameOptions
) {
if (options.language === 'kotlin') {
return parseUTSKotlinRuntimeStacktrace(stacktrace, options)
} else if (options.language === 'javascript') {
return parseUTSJavaScriptRuntimeStacktrace(stacktrace, options)
}
}
export function parseUTSSyntaxError(error: any, inputDir: string): string {
if (error instanceof Error) {
error = error.message
......
......@@ -9,8 +9,11 @@ import {
splitRE,
} from './utils'
interface GenerateJavaScriptRuntimeCodeFrameOptions
extends GenerateRuntimeCodeFrameOptions {}
export interface GenerateJavaScriptRuntimeCodeFrameOptions
extends GenerateRuntimeCodeFrameOptions {
language: 'javascript'
}
const JS_ERROR_RE = /\(\d+:\d+\)\s(.*)\s@([^\s]+\.js)\:(\d+)\:(\d+)/
const VUE_ERROR_RE = /@([^\s]+\.js)\:(\d+)\:(\d+)/
......
......@@ -183,9 +183,10 @@ function parseFilenameByClassName(className: string) {
return kotlinManifest.manifest[className.split('$')[0]] || 'index.kt'
}
interface GenerateKotlinRuntimeCodeFrameOptions
export interface GenerateKotlinRuntimeCodeFrameOptions
extends GenerateRuntimeCodeFrameOptions {
appid: string
language: 'kotlin'
}
export function parseUTSKotlinRuntimeStacktrace(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册