From d42f3913775a31598cdb7357dd2cdb0cc480d4df Mon Sep 17 00:00:00 2001 From: yangbo <1442420648@qq.com> Date: Sun, 13 Mar 2022 16:51:12 +0800 Subject: [PATCH] yangbo198@huawei.com Signed-off-by: yangbo <1442420648@qq.com> Change-Id: Icb7c53ca27b6b17a79d9eea3254b7eef296bd353 --- compiler/main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/main.js b/compiler/main.js index 8b7fbca..96d251b 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -90,9 +90,10 @@ function loadEntryObj(projectConfig) { if (manifest.pages) { const pages = manifest.pages; pages.forEach((element) => { - const fileName = projectConfig.projectPath + path.sep + element + '.ets'; + const sourcePath = element.replace(/^\.\/ets\//, ''); + const fileName = projectConfig.projectPath + path.sep + sourcePath + '.ets'; if (fs.existsSync(fileName)) { - projectConfig.entryObj['./' + element] = fileName + '?entry'; + projectConfig.entryObj['./' + sourcePath] = fileName + '?entry'; } else { throw Error(`\u001b[31m ERROR: page '${fileName}' does not exist. \u001b[39m`).message; }