Skip to content

Commit b14cd9a

Browse files
committed
fix(build): enable SSR branches in esm-browser builds
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.
1 parent 01032db commit b14cd9a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rollup.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function createConfig(format, output, plugins = []) {
176176
// is targeting Node (SSR)?
177177
__CJS__: String(isCJSBuild),
178178
// need SSR-specific branches?
179-
__SSR__: String(isCJSBuild || isBundlerESMBuild || isServerRenderer),
179+
__SSR__: String(!isGlobalBuild),
180180

181181
// 2.x compat build
182182
__COMPAT__: String(isCompatBuild),

scripts/dev.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ for (const target of targets) {
143143
__ESM_BUNDLER__: String(format.includes('esm-bundler')),
144144
__ESM_BROWSER__: String(format.includes('esm-browser')),
145145
__CJS__: String(format === 'cjs'),
146-
__SSR__: String(format === 'cjs' || format.includes('esm-bundler')),
146+
__SSR__: String(format !== 'global'),
147147
__COMPAT__: String(target === 'vue-compat'),
148148
__FEATURE_SUSPENSE__: `true`,
149149
__FEATURE_OPTIONS_API__: `true`,

0 commit comments

Comments
 (0)