From b3c86621e0f6969c8eea227b4cb9ead7a4e1e3fd Mon Sep 17 00:00:00 2001 From: yaojn Date: Tue, 2 Sep 2025 18:49:18 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E5=85=A5=E5=8F=A3=E6=96=87=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E9=A1=B9=E7=9B=AE=E5=90=AF=E5=8A=A8=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E3=80=82=20=20=20-=20[=E5=85=B3=E8=81=94]#[1501564391?= =?UTF-8?q?358464]=E6=A8=A1=E5=9D=97=E7=BC=BA=E5=B0=91=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E6=96=87=E4=BB=B6=EF=BC=8C=E5=AF=BC=E8=87=B4=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=A4=B1=E8=B4=A5=E3=80=82=20http://192.168.?= =?UTF-8?q?0.96:8090/demo/rdm.html#/bug-detail/939050947543040/93905094754?= =?UTF-8?q?3057/1501564391358464?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rsbuild.config.ts | 20 ++++++++++++-------- vue.config.js | 20 ++++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/rsbuild.config.ts b/rsbuild.config.ts index e39e5675..6c90c9b3 100644 --- a/rsbuild.config.ts +++ b/rsbuild.config.ts @@ -107,14 +107,18 @@ function getPages(pageList) { entry = `${communityModule}/${moduleName}/${filename}.js`; } else if (commercialModuleList.includes(filename)) { entry = `${commercialModule}/${moduleName}/${filename}.js`; - } - pages[filename] = { - entry, - template: `public/index.html`, - filename: `${filename}.html`, - title: pageLogin, - chunks: [`chunk-vendors`, `chunk-common`, filename] - }; + } + const entryPath = path.resolve(__dirname, entry); + const needEntry = glob.sync(entryPath); + if (needEntry.length > 0) { + pages[filename] = { + entry, + template: `public/index.html`, + filename: `${filename}.html`, + title: pageLogin, + chunks: [`chunk-vendors`, `chunk-common`, filename] + }; + } }); return pages; diff --git a/vue.config.js b/vue.config.js index 0a1b8c0b..705fcd99 100755 --- a/vue.config.js +++ b/vue.config.js @@ -82,14 +82,18 @@ function getPages(pageList) { } else if (commercialModuleList.includes(filename)) { entry = `${commercialModule}/${moduleName}/${filename}.js`; } - newpage[filename] = { - entry: entry, - template: `public/index.html`, - filename: `${filename}.html`, - title: pageLogin, // 标题名称+参数 - chunks: [`chunk-vendors`, `chunk-common`, filename] - }; - Object.assign(pages, newpage); + const entryPath = path.resolve(__dirname, entry); + const needEntry = glob.sync(entryPath); + if (needEntry.length > 0) { + newpage[filename] = { + entry: entry, + template: `public/index.html`, + filename: `${filename}.html`, + title: pageLogin, // 标题名称+参数 + chunks: [`chunk-vendors`, `chunk-common`, filename] + }; + Object.assign(pages, newpage); + } }); } else { //eg:['process','dashboard'] -- Gitee