Skip to content

Commit

Permalink
fix(runtime): 不引入 babel-types
Browse files Browse the repository at this point in the history
修复自动 import 引入的 babel-types、lodash,减少包大小
  • Loading branch information
Chen-jj committed Jul 8, 2020
1 parent ec17056 commit 3303ba6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/taro-runtime/src/dsl/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { document } from '../bom/document'
import { isFunction, noop, ensure, capitalize, toCamelCase, internalComponents, hasOwn } from '@tarojs/shared'
import { isBrowser } from '../env'
import { options } from '../options'
import { isBooleanLiteral } from 'babel-types'
import { isBooleanStringLiteral } from '@tarojs/shared'
import { Reconciler } from '../reconciler'

export type V = typeof VueCtor
Expand Down Expand Up @@ -59,7 +59,7 @@ function setReconciler () {
if (
compName in internalComponents &&
hasOwn(internalComponents[compName], qualifiedName) &&
isBooleanLiteral(internalComponents[compName][qualifiedName])
isBooleanStringLiteral(internalComponents[compName][qualifiedName])
) {
// avoid attribute being removed because set false value in vue
dom.setAttribute(qualifiedName, false)
Expand Down
5 changes: 2 additions & 3 deletions packages/taro-runtime/src/dsl/vue3.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { isFunction, isArray, ensure, capitalize, toCamelCase, internalComponents, hasOwn } from '@tarojs/shared'
import { isBooleanLiteral } from 'babel-types'
import { isFunction, isArray, ensure, capitalize, toCamelCase, internalComponents, hasOwn, isBooleanStringLiteral } from '@tarojs/shared'
import { AppInstance } from './instance'
import { Current } from '../current'
import { injectPageInstance } from './common'
Expand Down Expand Up @@ -57,7 +56,7 @@ function setReconciler () {
if (
compName in internalComponents &&
hasOwn(internalComponents[compName], qualifiedName) &&
isBooleanLiteral(internalComponents[compName][qualifiedName])
isBooleanStringLiteral(internalComponents[compName][qualifiedName])
) {
// avoid attribute being removed because set false value in vue
dom.setAttribute(qualifiedName, false)
Expand Down

0 comments on commit 3303ba6

Please sign in to comment.