Skip to content

Commit cdb45bd

Browse files
author
mengxiong10
committed
build: preset-jsx
1 parent 32c74a4 commit cdb45bd

File tree

5 files changed

+131
-51
lines changed

5 files changed

+131
-51
lines changed

.babelrc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
// Parceljs cann't compile babel.config.js
22
{
33
"presets": [
4+
["@vue/babel-preset-jsx"],
45
[
56
"@babel/preset-env",
67
{
78
"modules": false
89
}
910
]
1011
],
11-
"plugins": ["transform-vue-jsx", "@babel/plugin-transform-object-assign"],
12+
"plugins": ["@babel/plugin-transform-object-assign"],
1213
"env": {
1314
"test": {
1415
"presets": [
16+
["@vue/babel-preset-jsx"],
1517
[
1618
"@babel/preset-env",
1719
{
@@ -20,8 +22,7 @@
2022
}
2123
}
2224
]
23-
],
24-
"plugins": ["transform-vue-jsx"]
25+
]
2526
}
2627
}
2728
}

babel.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ module.exports = api => {
33
api.cache(false);
44
return {
55
presets: [
6+
['@vue/babel-preset-jsx'],
67
[
78
'@babel/preset-env',
89
{
910
modules: false,
1011
},
1112
],
1213
],
13-
plugins: ['transform-vue-jsx', '@babel/plugin-transform-object-assign'],
14+
plugins: ['@babel/plugin-transform-object-assign'],
1415
env: {
1516
test: {
1617
presets: [
18+
['@vue/babel-preset-jsx'],
1719
[
1820
'@babel/preset-env',
1921
{
@@ -23,7 +25,6 @@ module.exports = api => {
2325
},
2426
],
2527
],
26-
plugins: ['transform-vue-jsx'],
2728
},
2829
},
2930
};

example/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</head>
1111
<body>
1212
<div id="app"></div>
13-
<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
13+
<script src="https://unpkg.com/vue@2.6.10/dist/vue.runtime.min.js"></script>
1414
<script src="https://unpkg.com/vue2-datepicker/index.min.js"></script>
1515
<script src="https://unpkg.com/vue2-datepicker/locale/zh-cn.js"></script>
1616
<script src="./index.js"></script>

0 commit comments

Comments
 (0)