Skip to content

Commit

Permalink
build: include ssrUtils in server-renderer browser build
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 25, 2022
1 parent 2035fa0 commit 3cfe5f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/runtime-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const _ssrUtils = {
}

/**
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
* @internal
*/
export const ssrUtils = (__SSR__ ? _ssrUtils : null) as typeof _ssrUtils
Expand Down
8 changes: 5 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ function createConfig(format, output, plugins = []) {
!packageOptions.enableNonBrowserBranches,
isGlobalBuild,
isNodeBuild,
isCompatBuild
isCompatBuild,
isServerRenderer
),
...nodePlugins,
...plugins
Expand All @@ -228,7 +229,8 @@ function createReplacePlugin(
isBrowserBuild,
isGlobalBuild,
isNodeBuild,
isCompatBuild
isCompatBuild,
isServerRenderer
) {
const replacements = {
__COMMIT__: `"${process.env.COMMIT}"`,
Expand All @@ -248,7 +250,7 @@ function createReplacePlugin(
// is targeting Node (SSR)?
__NODE_JS__: isNodeBuild,
// need SSR-specific branches?
__SSR__: isNodeBuild || isBundlerESMBuild,
__SSR__: isNodeBuild || isBundlerESMBuild || isServerRenderer,

// for compiler-sfc browser build inlined deps
...(isBrowserESMBuild
Expand Down

0 comments on commit 3cfe5f9

Please sign in to comment.