From 5cdfc062027978366f57061b762cf6d4bcf1ca8a Mon Sep 17 00:00:00 2001 From: renzhenhua <908237408@qq.com> Date: Thu, 23 Nov 2023 15:08:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[Issues:=20#I8IOGJ]=20bob=20build=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/qa.md | 15 +++++++++++++++ zh-cn/tgz.md | 22 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/zh-cn/qa.md b/zh-cn/qa.md index 6961800..249fa12 100644 --- a/zh-cn/qa.md +++ b/zh-cn/qa.md @@ -43,6 +43,21 @@ copyAssets(assets, args.assetsDest); 将 node_modules 的 `react-native/Libraries/Utilities/Platform.d.ts` 替换成 react-native-harmony 包里 `react-native-harmony/Libraries/Utilities/Platform.d.ts`。 +### 1.5 bob-build 时报错:"harmony/***/hvigorfile.ts:2:26 - error TS2307: Cannot find module '@ohos/hvigor-ohos-plugin' or its corresponding type declarations." + +把 hvigorfile.ts所在目录(如:"harmony" )添加到添加到tsconfig.build.json文件的exclude中,bob-build时就不会对harmony下面文件编译成js。 + +**tsconfig.build.json** + +```json +{ + "extends": "./tsconfig", + "exclude": ["example","harmony"] +} +``` + + + ## 2. 环境配置相关 ### 2.1 ArkTs 语法校验报错 diff --git a/zh-cn/tgz.md b/zh-cn/tgz.md index f017a96..5d26e9e 100644 --- a/zh-cn/tgz.md +++ b/zh-cn/tgz.md @@ -83,6 +83,28 @@ + + +#### **tsconfig.build.json** + +把 harmony 添加到exclude中,否则执行bob-build会将其中的ts/ets编译为js,编译失败会报错,导致bob失败。例如harmony/**/hvigorfile.ts + +```json +{ + "extends": "./tsconfig", + "exclude": ["example","harmony"] +} +``` +报错信息如下: + +```js +harmony/blur/hvigorfile.ts:2:26 - error TS2307: Cannot find module '@ohos/hvigor-ohos-plugin' or its corresponding type declarations. + +2 export { harTasks } from '@ohos/hvigor-ohos-plugin'; +``` + + + ### 执行打包命令 ```bash -- Gitee From cd886e60a8017657f444ea7c5c8ca9f5d8e642b1 Mon Sep 17 00:00:00 2001 From: renzhenhua <908237408@qq.com> Date: Mon, 27 Nov 2023 11:13:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[Issues:=20#I8IOGJ]=20bob=20build=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + zh-cn/tgz.md | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/zh-cn/tgz.md b/zh-cn/tgz.md index 5d26e9e..fa8355f 100644 --- a/zh-cn/tgz.md +++ b/zh-cn/tgz.md @@ -83,8 +83,6 @@ - - #### **tsconfig.build.json** 把 harmony 添加到exclude中,否则执行bob-build会将其中的ts/ets编译为js,编译失败会报错,导致bob失败。例如harmony/**/hvigorfile.ts @@ -103,8 +101,6 @@ harmony/blur/hvigorfile.ts:2:26 - error TS2307: Cannot find module '@ohos/hvigor 2 export { harTasks } from '@ohos/hvigor-ohos-plugin'; ``` - - ### 执行打包命令 ```bash -- Gitee