modify errorfile path tip

Signed-off-by: yfwang6 <wangyongfei6@huawei.com>
Change-Id: Id443196028c8f32bcd6819296ad7b125b7e4b285
This commit is contained in:
yfwang6
2022-07-15 15:03:38 +08:00
parent 3454475354
commit f606914354
+2 -3
View File
@@ -98,12 +98,11 @@ function loadEntryObj(projectConfig) {
const pages = manifest.pages;
pages.forEach((element) => {
const sourcePath = element.replace(/^\.\/ets\//, '');
const fileName = projectConfig.projectPath + path.sep + sourcePath + '.ets';
const fileName = path.resolve(projectConfig.projectPath, sourcePath + '.ets');
if (fs.existsSync(fileName)) {
projectConfig.entryObj['./' + sourcePath] = fileName + '?entry';
} else {
const errorFileName = path.resolve(projectConfig.projectPath, sourcePath + '.ets');
throw Error(`\u001b[31m ERROR: page '${errorFileName}' does not exist. \u001b[39m`).message;
throw Error(`\u001b[31m ERROR: page '${fileName}' does not exist. \u001b[39m`).message;
}
});
} else {