From: Evan You Date: Tue, 27 Jul 2021 21:59:13 +0000 (-0400) Subject: fix(runtime-core): expose ssrUtils in esm-bundler build X-Git-Tag: v3.2.0-beta.6~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee4cbaeec917362c571ce95352adccd6ec2d1f47;p=thirdparty%2Fvuejs%2Fcore.git fix(runtime-core): expose ssrUtils in esm-bundler build this is necessary for worker environments where Vue needs to be bundled (instead of using cjs build via Node.js require) fix #4199 --- diff --git a/packages/runtime-core/src/index.ts b/packages/runtime-core/src/index.ts index 26e70dd914..5fbcc8925a 100644 --- a/packages/runtime-core/src/index.ts +++ b/packages/runtime-core/src/index.ts @@ -313,7 +313,9 @@ const _ssrUtils = { * SSR utils for \@vue/server-renderer. Only exposed in cjs builds. * @internal */ -export const ssrUtils = (__NODE_JS__ ? _ssrUtils : null) as typeof _ssrUtils +export const ssrUtils = ( + __NODE_JS__ || __ESM_BUNDLER__ ? _ssrUtils : null +) as typeof _ssrUtils // 2.x COMPAT ------------------------------------------------------------------