From b1d407019364186a82660b93381d46205d4c82fe Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 7 Jul 2023 04:09:03 -0400 Subject: [PATCH] fix: set esbuild mainFields and conditions to prioritize cjs --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index ed9808f..92252ff 100644 --- a/src/index.ts +++ b/src/index.ts @@ -81,6 +81,8 @@ export default async function (context: PresetContext): Promise { format: "cjs", bundle: true, platform: "node", + mainFields: ["main", "module"], + conditions: ["require"], }, }, variable: DEFAULT_VARIABLE,