Skip to content

Commit

Permalink
fix(build): enable SSR branches in esm-browser builds
Browse files Browse the repository at this point in the history
This enables the logic necessary to pick up the correct current instance
when using esm-browser builds for in-browser SSR, and fixes the problem
of `getCurrentInstance()` returning null during SSR in the SFC playground.
  • Loading branch information
yyx990803 committed Jul 19, 2024
1 parent 01032db commit b14cd9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function createConfig(format, output, plugins = []) {
// is targeting Node (SSR)?
__CJS__: String(isCJSBuild),
// need SSR-specific branches?
__SSR__: String(isCJSBuild || isBundlerESMBuild || isServerRenderer),
__SSR__: String(!isGlobalBuild),

// 2.x compat build
__COMPAT__: String(isCompatBuild),
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ for (const target of targets) {
__ESM_BUNDLER__: String(format.includes('esm-bundler')),
__ESM_BROWSER__: String(format.includes('esm-browser')),
__CJS__: String(format === 'cjs'),
__SSR__: String(format === 'cjs' || format.includes('esm-bundler')),
__SSR__: String(format !== 'global'),
__COMPAT__: String(target === 'vue-compat'),
__FEATURE_SUSPENSE__: `true`,
__FEATURE_OPTIONS_API__: `true`,
Expand Down

0 comments on commit b14cd9a

Please sign in to comment.