diff --git a/packages/uni-app-harmony/build.ets.json b/packages/uni-app-harmony/build.ets.json index e16931f275afee7e28d1f81b92b32d60c54b7d0e..275d6527c5ab4462b5ea3e181ced108f65591828 100644 --- a/packages/uni-app-harmony/build.ets.json +++ b/packages/uni-app-harmony/build.ets.json @@ -12,9 +12,9 @@ "@dcloudio/uni-i18n": "/packages/uni-i18n/src", "@dcloudio/uni-platform": "/packages/uni-app-harmony/src/platform", "@dcloudio/uni-shared": "/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", diff --git a/packages/uni-uts-v1/src/arkts.ts b/packages/uni-uts-v1/src/arkts.ts index 2373b1df5933fc3453b9430484db6dfb39517eec..c55fad879527702ee240f7c2918ec46825b959d8 100644 --- a/packages/uni-uts-v1/src/arkts.ts +++ b/packages/uni-uts-v1/src/arkts.ts @@ -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,