diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..496ee2ca6a2f08396a4076fe43dedf3dc0da8b6d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/zh-cn/qa.md b/zh-cn/qa.md index 6961800d88b783701ba84856144f7bc362f2f107..249fa12c1ac1fb9a5b818d2fde66162ff883eab5 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 f017a9639316d004c6cbf02a5fcb75811a8c30e7..fa8355ff18cc3efe1f06736fac8e6607353c8e19 100644 --- a/zh-cn/tgz.md +++ b/zh-cn/tgz.md @@ -83,6 +83,24 @@ +#### **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