[improvement] upgrade babel-preset-jsx (#2452)

This commit is contained in:
neverland 2019-01-07 14:55:55 +08:00 committed by GitHub
parent bf50db9ea0
commit ed7febc131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 90 additions and 20 deletions

View File

@ -12,6 +12,13 @@ module.exports = function (api) {
loose: true,
modules: useESModules ? false : 'commonjs'
}
],
[
'@vue/babel-preset-jsx',
{
vModel: true,
injectH: true
}
]
],
plugins: [
@ -24,7 +31,6 @@ module.exports = function (api) {
useESModules
}
],
'transform-vue-jsx',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-object-assign'
]

View File

@ -77,14 +77,14 @@
"@vant/doc": "^1.0.21",
"@vant/eslint-config": "^1.0.8",
"@vant/markdown-loader": "^1.0.3",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.1",
"@vue/babel-preset-jsx": "^1.0.0-beta.1",
"@vue/server-test-utils": "^1.0.0-beta.26",
"@vue/test-utils": "^1.0.0-beta.26",
"autoprefixer": "^9.4.3",
"babel-core": "^7.0.0-0",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.4",
"babel-plugin-transform-vue-jsx": "4.0.1",
"codecov": "^3.1.0",
"cross-env": "^5.2.0",
"css-loader": "^2.1.0",

View File

@ -8,13 +8,16 @@ exports[`renders demo correctly 1`] = `
<!---->
</div>
</a> <a class="van-badge van-hairline">
<div class="van-badge__text">标签名称<div class="van-info van-badge__info">8</div>
<div class="van-badge__text">标签名称
<div class="van-info van-badge__info">8</div>
</div>
</a> <a class="van-badge van-hairline">
<div class="van-badge__text">标签名称<div class="van-info van-badge__info">99</div>
<div class="van-badge__text">标签名称
<div class="van-info van-badge__info">99</div>
</div>
</a> <a class="van-badge van-hairline">
<div class="van-badge__text">标签名称<div class="van-info van-badge__info">99+</div>
<div class="van-badge__text">标签名称
<div class="van-info van-badge__info">99+</div>
</div>
</a></div>
</div>

View File

@ -4,12 +4,15 @@ exports[`renders demo correctly 1`] = `
<div>
<div>
<div class="van-card">
<div class="van-card__header"><a class="van-card__thumb"><img src="//img.yzcdn.cn/upload_files/2017/07/02/af5b9f44deaeb68000d7e4a711160c53.jpg" class="van-card__img"></a>
<div class="van-card__header"><a class="van-card__thumb"><img src="//img.yzcdn.cn/upload_files/2017/07/02/af5b9f44deaeb68000d7e4a711160c53.jpg" class="van-card__img">
</a>
<div class="van-card__content">
<div class="van-card__title">2018秋冬新款男士休闲时尚军绿飞行夹克秋冬新款男</div>
<div class="van-card__desc van-ellipsis">描述信息</div>
<div class="van-card__bottom">
<div class="van-card__price">¥ 2.00</div>
<div class="van-card__num">x 2</div>
</div>
</div>
@ -18,7 +21,8 @@ exports[`renders demo correctly 1`] = `
</div>
<div>
<div class="van-card">
<div class="van-card__header"><a class="van-card__thumb"><img src="//img.yzcdn.cn/upload_files/2017/07/02/af5b9f44deaeb68000d7e4a711160c53.jpg" class="van-card__img"><span class="van-tag van-tag--mark van-card__tag" style="background-color:#f44;">标签</span></a>
<div class="van-card__header"><a class="van-card__thumb"><img src="//img.yzcdn.cn/upload_files/2017/07/02/af5b9f44deaeb68000d7e4a711160c53.jpg" class="van-card__img">
<span class="van-tag van-tag--mark van-card__tag" style="background-color:#f44;">标签</span></a>
<div class="van-card__content">
<div class="van-card__title">2018秋冬新款男士休闲时尚军绿飞行夹克秋冬新款男</div>
<div class="van-card__desc van-ellipsis">描述信息</div>

View File

@ -724,6 +724,70 @@
highlight.js "^9.12.0"
markdown-it "^8.4.0"
"@vue/babel-helper-vue-jsx-merge-props@^1.0.0-beta.1":
version "1.0.0-beta.1"
resolved "https://registry.yarnpkg.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.0.0-beta.1.tgz#cbfa2b4fef05d0462fe770759fe1766ba223c1d1"
integrity sha512-N5uSbvShCF7pMuk4gOoMaM/oAhr4Vt5s1DRnevuhCeRP2UtwDC6GuFFNFuhuefOsWwpAX/PmrSxA6kDH/GGQlg==
"@vue/babel-plugin-transform-vue-jsx@^1.0.0-beta.1":
version "1.0.0-beta.1"
resolved "https://registry.yarnpkg.com/@vue/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-1.0.0-beta.1.tgz#ac1e8577eb6138a6f15025a0b2639cf9accd7b43"
integrity sha512-/ZV09X4BtA5OPdnQqQaxhD1aRBQF8PVY/ZUnQtrk4jld7+Mfy9CxT4gCznoJ+KFooCbyjvwhotB72Hg7N3T4zg==
dependencies:
"@babel/helper-module-imports" "^7.0.0"
"@babel/plugin-syntax-jsx" "^7.2.0"
"@vue/babel-helper-vue-jsx-merge-props" "^1.0.0-beta.1"
html-tags "^2.0.0"
lodash.kebabcase "^4.1.1"
svg-tags "^1.0.0"
"@vue/babel-preset-jsx@^1.0.0-beta.1":
version "1.0.0-beta.1"
resolved "https://registry.yarnpkg.com/@vue/babel-preset-jsx/-/babel-preset-jsx-1.0.0-beta.1.tgz#3af92fdc90387851ef7873525d081d193fac2140"
integrity sha512-Nx6+KEJKApsofsYElwFaU7bnBWjMatAgUBFR45qMNl2KpwVOrgNABCbrX/9IqxZIOGCpRuzD96pWmnxFnu2HVQ==
dependencies:
"@vue/babel-helper-vue-jsx-merge-props" "^1.0.0-beta.1"
"@vue/babel-plugin-transform-vue-jsx" "^1.0.0-beta.1"
"@vue/babel-sugar-functional-vue" "^1.0.0-beta.1"
"@vue/babel-sugar-inject-h" "^1.0.0-beta.1"
"@vue/babel-sugar-v-model" "^1.0.0-beta.1"
"@vue/babel-sugar-v-on" "^1.0.0-beta.1"
"@vue/babel-sugar-functional-vue@^1.0.0-beta.1":
version "1.0.0-beta.1"
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-functional-vue/-/babel-sugar-functional-vue-1.0.0-beta.1.tgz#9b883d7564c358fda938670cffd4603d5a86bded"
integrity sha512-FD53t0SxlkNtCk78C/fl1WR79tOLYMOEcku0ie0nKhjn/gy56fhYOMlUjutjE/mdVa4wHSHnz2WC7N8e4zbxPg==
dependencies:
"@babel/plugin-syntax-jsx" "^7.2.0"
"@vue/babel-sugar-inject-h@^1.0.0-beta.1":
version "1.0.0-beta.1"
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-inject-h/-/babel-sugar-inject-h-1.0.0-beta.1.tgz#89d56355aa69cc6074e6d28f311566cdb8522ba2"
integrity sha512-/0Key+jZfxjRb1b7NPS29rrYzPXGqoYxRim54eVFzcAF255O5DCcBDbePGb/ktza2aA8ZvzPfnc/uNxcLA82FQ==
dependencies:
"@babel/plugin-syntax-jsx" "^7.2.0"
"@vue/babel-sugar-v-model@^1.0.0-beta.1":
version "1.0.0-beta.1"
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-v-model/-/babel-sugar-v-model-1.0.0-beta.1.tgz#f52a67bfe235f34478fc5804453415231fb0d213"
integrity sha512-TLcBppivEHL9oeAafLfxBG3M4FFnVp1BX8joBJwvfgMOFgarNux8QhttbqQSMAAVX4j6GOf1xlXpXK2odQHB0w==
dependencies:
"@babel/plugin-syntax-jsx" "^7.2.0"
"@vue/babel-helper-vue-jsx-merge-props" "^1.0.0-beta.1"
"@vue/babel-plugin-transform-vue-jsx" "^1.0.0-beta.1"
camelcase "^5.0.0"
html-tags "^2.0.0"
svg-tags "^1.0.0"
"@vue/babel-sugar-v-on@^1.0.0-beta.1":
version "1.0.0-beta.1"
resolved "https://registry.yarnpkg.com/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.0.0-beta.1.tgz#2c98417ac625bbf1bad11fc3e103b7b6558fcb0e"
integrity sha512-K+QecqeKZseWoGkxMAuV08XqumPqBpQ681NwFsSZyj6Pfz5XpEPPlCH3nQ+7KC4yxjbH9bjIGVtkpvbONIfbvA==
dependencies:
"@babel/plugin-syntax-jsx" "^7.2.0"
"@vue/babel-plugin-transform-vue-jsx" "^1.0.0-beta.1"
camelcase "^5.0.0"
"@vue/component-compiler-utils@^2.0.0":
version "2.3.1"
resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-2.3.1.tgz#d1c2623f02ad3fe6b6fc9c3762be55c9c61e3977"
@ -1360,11 +1424,6 @@ babel-generator@^6.18.0, babel-generator@^6.26.0:
source-map "^0.5.7"
trim-right "^1.0.1"
babel-helper-vue-jsx-merge-props@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz#22aebd3b33902328e513293a8e4992b384f9f1b6"
integrity sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg==
babel-helpers@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2"
@ -1427,13 +1486,6 @@ babel-plugin-transform-strict-mode@^6.24.1:
babel-runtime "^6.22.0"
babel-types "^6.24.1"
babel-plugin-transform-vue-jsx@4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-4.0.1.tgz#2c8bddce87a6ef09eaa59869ff1bfbeeafc5f88d"
integrity sha512-wbOz7ITB5cloLSjKUU1hWn8zhR+Dwah/RZiTiJY/CQliCwhowmzu6m7NEF+y5EJX/blDzGjRtZvC10Vdb3Q7vw==
dependencies:
esutils "^2.0.2"
babel-preset-jest@^23.2.0:
version "23.2.0"
resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46"
@ -5651,6 +5703,11 @@ lodash.isarray@^3.0.0:
version "3.0.4"
resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55"
lodash.kebabcase@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36"
integrity sha1-hImxyw0p/4gZXM7KRI/21swpXDY=
lodash.keys@^3.0.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a"