fix: do not drop SFC runtime behavior code in global builds

fix #873
This commit is contained in:
Evan You 2020-03-23 15:10:35 -04:00
parent 4126a9dd51
commit 4c1a193617
3 changed files with 18 additions and 29 deletions

View File

@ -124,7 +124,6 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
}
return publicGetter(target)
} else if (
__BUNDLER__ &&
(cssModule = type.__cssModules) &&
(cssModule = cssModule[key])
) {

View File

@ -8,20 +8,15 @@ export let currentScopeId: string | null = null
const scopeIdStack: string[] = []
export function pushScopeId(id: string) {
if (__BUNDLER__) {
scopeIdStack.push((currentScopeId = id))
}
}
export function popScopeId() {
if (__BUNDLER__) {
scopeIdStack.pop()
currentScopeId = scopeIdStack[scopeIdStack.length - 1] || null
}
}
export function withScopeId(id: string): <T extends Function>(fn: T) => T {
if (__BUNDLER__) {
return ((fn: Function) =>
withCtx(function(this: any) {
pushScopeId(id)
@ -29,7 +24,4 @@ export function withScopeId(id: string): <T extends Function>(fn: T) => T {
popScopeId()
return res
})) as any
} else {
return undefined as any
}
}

View File

@ -563,7 +563,6 @@ function baseCreateRenderer(
}
// scopeId
if (__BUNDLER__) {
if (scopeId) {
hostSetScopeId(el, scopeId)
}
@ -573,7 +572,6 @@ function baseCreateRenderer(
if (treeOwnerId && treeOwnerId !== scopeId) {
hostSetScopeId(el, treeOwnerId + '-s')
}
}
// children
if (shapeFlag & ShapeFlags.TEXT_CHILDREN) {