From 7cc85428a408ad988733042cab4ca0f553b96dca Mon Sep 17 00:00:00 2001 From: SANmq <50514663+SANmq@users.noreply.github.com> Date: Mon, 27 May 2024 22:13:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AA=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E4=BE=9D=E8=B5=96exports=E5=AF=BC=E5=87=BA=5F=5FesMod?= =?UTF-8?q?ule=3Dtrue=E5=BC=95=E8=B5=B7=E7=9A=84=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit webpack本来可以正常处理模块,因为依赖导出带有__esModule.webpack导入的时候当成es模块处理去取default,结果模块里没有default,已经被esbuild导出的时候处理了,结果导致webpack 默认导入失败, --- packages/mfsu/src/depBuilder/getESBuildEntry.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mfsu/src/depBuilder/getESBuildEntry.ts b/packages/mfsu/src/depBuilder/getESBuildEntry.ts index be68f3b96ef5..5c1ab1f6ce40 100644 --- a/packages/mfsu/src/depBuilder/getESBuildEntry.ts +++ b/packages/mfsu/src/depBuilder/getESBuildEntry.ts @@ -6,10 +6,10 @@ const ES_INTEROP_FUNC = `__exportStar`; const ES_INTEROP_HELPER = ` var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + if (k !== '__esModule') Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - o[k2] = m[k]; + if (k !== '__esModule') o[k2] = m[k]; })); var ${ES_INTEROP_FUNC} = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);