From fb1b07c2dff5f9dfbf683af4cb5cf562ed113c8a Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 22 Dec 2021 16:46:54 +0800 Subject: [PATCH] houhaoyu@huawei.com update from wagner Signed-off-by: houhaoyu Change-Id: I327cf22bd12f70782e7a3b3d1efa44a87ffc0092 --- src/loader.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/loader.js b/src/loader.js index c7e919e..9ed7c10 100644 --- a/src/loader.js +++ b/src/loader.js @@ -319,6 +319,7 @@ function loadPageCheckElementLength (_this, elementLength, frag, elementNames, r if (!element.name) { element.name = path.parse(src).name } + checkEntry(_this, filePath, element.src) } else { logWarn(_this, [{ @@ -458,4 +459,20 @@ function loadPageCheckLite (extscript, extcss) { for (const key in legacy) { loader[key] = legacy[key] } + +function checkEntry(_this, filePath, elementSrc) { + if (_this._compilation.entries) { + for (var key of _this._compilation.entries.keys()) { + const entryPath = path.join(path.resolve(process.env.projectPath), key + '.hml'); + if (entryPath === filePath) { + logWarn(_this, [{ + reason: `WARNING: The page "${elementSrc}" configured in 'config.json'` + + ` can not be uesd as a custom component.` + + `To ensure that the debugging function is normal, please delete this page in 'config.json'.` + }]); + } + } + } +} + module.exports = loader \ No newline at end of file -- Gitee