diff --git a/packages/wrangler/src/dev.tsx b/packages/wrangler/src/dev.tsx index c01faa38ef6e..c72da71ea354 100644 --- a/packages/wrangler/src/dev.tsx +++ b/packages/wrangler/src/dev.tsx @@ -374,7 +374,14 @@ function useEsbuild(props: { ...(jsxFactory && { jsxFactory }), ...(jsxFragment && { jsxFragment }), external: ["__STATIC_CONTENT_MANIFEST"], - conditions: ["worker", "browser", "development", "module", "default"], + conditions: [ + "worker", + "browser", + "development", + "module", + "imports", + "default", + ], plugins: [moduleCollector.plugin], // TODO: import.meta.url watch: { diff --git a/packages/wrangler/src/publish.ts b/packages/wrangler/src/publish.ts index 6e809138cc75..9ea30fba4648 100644 --- a/packages/wrangler/src/publish.ts +++ b/packages/wrangler/src/publish.ts @@ -105,6 +105,7 @@ export default async function publish(props: Props): Promise { "browser", envName === "production" ? "production" : false, "module", + "imports", "default", ].filter(Boolean) as string[], loader: {