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

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

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