提交 3719024c 编写于 作者: 雪洛's avatar 雪洛

feat(harmony): 调整ets runtime引用路径

上级 b2b6d677
......@@ -12,9 +12,9 @@
"@dcloudio/uni-i18n": "<rootDir>/packages/uni-i18n/src",
"@dcloudio/uni-platform": "<rootDir>/packages/uni-app-harmony/src/platform",
"@dcloudio/uni-shared": "<rootDir>/packages/uni-shared/src",
"@dcloudio/uni-runtime": "../../../resources/rawfile/uni-app/uni-app-harmony-framework-dev"
"@dcloudio/uni-runtime": "@dcloudio/uni-app-harmony-framework"
},
"externals": ["../../../resources/rawfile/uni-app/uni-app-harmony-framework-dev"],
"externals": ["@dcloudio/uni-app-harmony-framework"],
"replacements": {
"__PLATFORM__": "'app-harmony'",
"__DEV__": "false",
......@@ -22,7 +22,7 @@
"__APP_VIEW__": "false",
"__NODE_JS__": "false"
},
"banner": "import { IUniError, UTSObject, UniError, UTSJSONObject, string, ComponentPublicInstance, ComponentInternalInstance, defineAsyncApi, defineSyncApi, defineTaskApi, defineOnApi, defineOffApi, getUniProvider, getUniProviders, AsyncApiSuccessResult, AsyncApiResult, ApiExecutor, ProtocolOptions, ApiOptions, ApiError, UniProvider } from '@dcloudio/uni-app-ohos-runtime'",
"banner": "import { IUTSObject, UTSObject, UTSJSONObject } from '@dcloudio/uts-harmony'\nimport { IUniError, UniError, string, ComponentPublicInstance, ComponentInternalInstance, defineAsyncApi, defineSyncApi, defineTaskApi, defineOnApi, defineOffApi, getUniProvider, getUniProviders, AsyncApiSuccessResult, AsyncApiResult, ApiExecutor, ProtocolOptions, ApiOptions, ApiError, UniProvider } from '@dcloudio/uni-app-harmony'\n",
"wrapper": {
"name": "initUniExtApi",
"args": [["APP_ID", "string"]]
......@@ -32,9 +32,9 @@
"../uni-runtime/src/helpers/api/index.ts": "uni-api-shared.ets"
},
"alias": {
"@dcloudio/uni-runtime": "../../../resources/rawfile/uni-app/uni-app-harmony-framework-dev"
"@dcloudio/uni-runtime": "@dcloudio/uni-app-harmony-framework"
},
"externals": ["../../../resources/rawfile/uni-app/uni-app-harmony-framework-dev"],
"externals": ["@dcloudio/uni-app-harmony-framework"],
"replacements": {
"__PLATFORM__": "'app-harmony'",
"__DEV__": "false",
......
......@@ -29,18 +29,17 @@ export async function compileArkTS(
projectPath,
pluginId
)
const globals = [
const utsGlobals = ['IUTSObject', 'UTSObject', 'UTSJSONObject']
const uniAppGlobals = [
'IUniError',
'IUTSObject',
'UniError',
'UTSObject',
'UTSJSONObject',
'string',
'ComponentPublicInstance',
'ComponentInternalInstance',
]
const banners: string[] = [
`import { ${globals.join(', ')} } from '@dcloudio/uni-app-ohos-runtime'`,
`import { ${utsGlobals.join(', ')} } from '@dcloudio/uts-harmony'`,
`import { ${uniAppGlobals.join(', ')} } from '@dcloudio/uni-app-harmony'`,
]
if (isExtApi) {
const globals = [
......@@ -60,7 +59,7 @@ export async function compileArkTS(
'UniProvider',
]
banners.push(
`import { ${globals.join(', ')} } from '@dcloudio/uni-app-ohos-runtime'`
`import { ${globals.join(', ')} } from '@dcloudio/uni-app-harmony'`
)
}
const buildOptions: UTSBundleOptions = {
......@@ -69,12 +68,9 @@ export async function compileArkTS(
root: inputDir,
filename,
paths: {
'@dcloudio/uni-runtime':
'../../../../../resources/rawfile/uni-app/uni-app-harmony-framework-dev',
'@dcloudio/uni-runtime': '@dcloudio/uni-app-harmony-framework',
},
externals: [
'../../../../../resources/rawfile/uni-app/uni-app-harmony-framework-dev',
],
externals: ['@dcloudio/uni-app-harmony-framework'],
parseOptions: {
tsx: true,
noEarlyErrors: true,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册