Skip to content

Commit

Permalink
fix(runtime-core): expose ssrUtils in esm-bundler build
Browse files Browse the repository at this point in the history
this is necessary for worker environments where Vue needs to be
bundled (instead of using cjs build via Node.js require)

fix #4199
  • Loading branch information
yyx990803 committed Jul 27, 2021
1 parent 561e210 commit ee4cbae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/runtime-core/src/index.ts
Expand Up @@ -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 ------------------------------------------------------------------

Expand Down

0 comments on commit ee4cbae

Please sign in to comment.