refactor: move dom tag config to shared

Otherwise runtime-dom cjs & esm builds will import compiler-dom
This commit is contained in:
Evan You 2019-11-06 15:22:46 -05:00
parent acbbe3298c
commit d7eab51315
5 changed files with 8 additions and 8 deletions

View File

@ -28,4 +28,3 @@ export function compile(
}
export * from '@vue/compiler-core'
export * from './tagConfig'

View File

@ -5,8 +5,7 @@ import {
Namespaces,
NodeTypes
} from '@vue/compiler-core'
import { isVoidTag, isHTMLTag, isSVGTag } from './tagConfig'
import { makeMap } from '@vue/shared'
import { makeMap, isVoidTag, isHTMLTag, isSVGTag } from '@vue/shared'
const isRawTextContainer = /*#__PURE__*/ makeMap(
'style,iframe,script,noscript',

View File

@ -7,8 +7,7 @@ import {
import { nodeOps } from './nodeOps'
import { patchProp } from './patchProp'
// Importing from the compiler, will be tree-shaken in prod
import { isHTMLTag, isSVGTag } from '@vue/compiler-dom'
import { isFunction, isString } from '@vue/shared'
import { isFunction, isString, isHTMLTag, isSVGTag } from '@vue/shared'
const { render: baseRender, createApp: baseCreateApp } = createRenderer({
patchProp,

View File

@ -1,4 +1,6 @@
import { makeMap } from '../../shared/src/makeMap'
// These tag configs are shared between compiler-dom and runtime-dom, so they
// must be extracted in shared to avoid creating a dependency between the two.
import { makeMap } from './makeMap'
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element
const HTML_TAGS =

View File

@ -2,8 +2,9 @@ import { makeMap } from './makeMap'
export { makeMap }
export * from './patchFlags'
export { isGloballyWhitelisted } from './globalsWhitelist'
export { generateCodeFrame } from './codeframe'
export * from './globalsWhitelist'
export * from './codeframe'
export * from './domTagConfig'
export const EMPTY_OBJ: { readonly [key: string]: any } = __DEV__
? Object.freeze({})