ohos-router 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/router.ts +5 -5
package/package.json
CHANGED
package/router.ts
CHANGED
|
@@ -129,7 +129,7 @@ export function pluginStart(node: HvigorNode, isExecute: boolean) {
|
|
|
129
129
|
|
|
130
130
|
try {
|
|
131
131
|
let moduleJson5Path = FileUtil.pathResolve(entryModulePath + "/src/main/", "module.json5")
|
|
132
|
-
let moduleJson5Data = FileUtil.
|
|
132
|
+
let moduleJson5Data = FileUtil.readFileSync(moduleJson5Path)
|
|
133
133
|
moduleJson5JSONParse(moduleJson5Data)
|
|
134
134
|
let appPath = FileUtil.pathResolve(entryModulePath + "/src/main/ets/", "App.ets")
|
|
135
135
|
if (moduleSrcEntry == undefined) {
|
|
@@ -216,12 +216,12 @@ export function pluginStart(node: HvigorNode, isExecute: boolean) {
|
|
|
216
216
|
|
|
217
217
|
let moduleSrcEntry: string
|
|
218
218
|
|
|
219
|
-
function moduleJson5JSONParse(
|
|
219
|
+
function moduleJson5JSONParse(moduleJson5Data: string) {
|
|
220
220
|
try {
|
|
221
|
+
let moduleJsonBean = JSON.parse(moduleJson5Data)
|
|
221
222
|
let module = moduleJsonBean.module
|
|
222
223
|
moduleSrcEntry = module.srcEntry
|
|
223
224
|
} catch (error) {
|
|
224
|
-
let moduleJson5Data = JSON.stringify(moduleJsonBean)
|
|
225
225
|
let errorArray = error.message.split(" ")
|
|
226
226
|
let position = Number(errorArray[errorArray.length - 1])
|
|
227
227
|
let endString = moduleJson5Data.substring(0, position)
|
|
@@ -308,8 +308,8 @@ var buildProfilePath = ""
|
|
|
308
308
|
|
|
309
309
|
function writeBuildProfile(childNode: HvigorNode) {
|
|
310
310
|
let ohPackagePath = FileUtil.pathResolve(childNode.getNodePath(), "oh-package.json5")
|
|
311
|
-
let ohPackageData = FileUtil.
|
|
312
|
-
dependenciesJSONParse(
|
|
311
|
+
let ohPackageData = FileUtil.readFileSync(ohPackagePath)
|
|
312
|
+
dependenciesJSONParse(ohPackageData.toString())
|
|
313
313
|
buildProfilePath = FileUtil.pathResolve(childNode.getNodePath(), "build-profile.json5")
|
|
314
314
|
let buildProfileData = FileUtil.readFileSync(buildProfilePath)
|
|
315
315
|
buildProfileJSONParse(buildProfileData.toString())
|