From 2fb2f40bcbce661afdae4ba5fa9d1e786dc7f919 Mon Sep 17 00:00:00 2001 From: huangzhihua Date: Fri, 15 Mar 2019 11:39:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=20usingComponents=20?= =?UTF-8?q?=E4=B8=AD=E8=B7=AF=E5=BE=84=E9=94=99=E8=AF=AF=EF=BC=8C=E6=9C=80?= =?UTF-8?q?=E7=BB=88=E4=BC=9A=E6=8A=9B=E5=87=BA=20TypeError:=20Cannot=20re?= =?UTF-8?q?ad=20property=20replace=20of=20undefined=20=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=B8=8D=E5=87=86=E7=A1=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 3220abd..3ca77c7 100644 --- a/src/index.js +++ b/src/index.js @@ -395,7 +395,12 @@ export default class WXAppPlugin { .filter(resource => resource !== 'app') .forEach(resource => { const fullPath = this.getFullScriptPath(resource); - this.addScriptEntry(compiler, fullPath, resource); + if (typeof fullPath === 'undefined') { + throw new Error(`ENOENT: no such file or directory, '${resource}'`); + } + else { + this.addScriptEntry(compiler, fullPath, resource); + } }); }