forked from daren.hsu/line_push
update
This commit is contained in:
+19
-13
@@ -17,31 +17,37 @@ yarn add @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props
|
||||
npm install @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props --save
|
||||
```
|
||||
|
||||
In your `.babelrc`:
|
||||
In your `babel.config.js`:
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": ["@vue/babel-preset-jsx"]
|
||||
```js
|
||||
module.exports = {
|
||||
presets: ['@vue/babel-preset-jsx'],
|
||||
}
|
||||
```
|
||||
|
||||
You can toggle specific features, by default all features are enabled, e.g.:
|
||||
You can toggle specific features, by default all features (except `compositionAPI`) are enabled, e.g.:
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
```js
|
||||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
"@vue/babel-preset-jsx",
|
||||
'@vue/babel-preset-jsx',
|
||||
{
|
||||
"vModel": false
|
||||
}
|
||||
]
|
||||
]
|
||||
vModel: false,
|
||||
compositionAPI: true,
|
||||
},
|
||||
],
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
Options are:
|
||||
|
||||
- `compositionAPI` - Enables [@vue/babel-sugar-composition-api-inject-h](../babel-sugar-composition-api-inject-h) and [@vue/babel-sugar-composition-api-render-instance](../babel-sugar-composition-api-render-instance), support returning render function in `setup`.
|
||||
- The default value is `false`;
|
||||
- When set to `'auto'` (or `true`), it will detect the Vue version in the project. If it's >= 2.7, it will import the composition utilities from `vue`, otherwise from `@vue/composition-api`;
|
||||
- When set to `'native'` (or `'naruto'`), it will always import the composition utilities from `vue`
|
||||
- When set to `plugin`, it will always import the composition utilities from `@vue/composition-api`
|
||||
- `functional` [@vue/babel-sugar-functional-vue](../babel-sugar-functional-vue/README.md) - Functional components syntactic sugar
|
||||
- `injectH` [@vue/babel-sugar-inject-h](../babel-sugar-inject-h/README.md) - Automatic `h` injection syntactic sugar
|
||||
- `vModel` [@vue/babel-sugar-v-model](../babel-sugar-v-model/README.md) - `vModel` syntactic sugar
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
"use strict";function _interopDefault(a){return a&&"object"==typeof a&&"default"in a?a["default"]:a}var babelPluginTransformVueJsx=_interopDefault(require("@vue/babel-plugin-transform-vue-jsx")),babelSugarFunctionalVue=_interopDefault(require("@vue/babel-sugar-functional-vue")),babelSugarInjectH=_interopDefault(require("@vue/babel-sugar-inject-h")),babelSugarVModel=_interopDefault(require("@vue/babel-sugar-v-model")),babelSugarVOn=_interopDefault(require("@vue/babel-sugar-v-on")),index=(a,{functional:b=!0,injectH:c=!0,vModel:d=!0,vOn:e=!0}={})=>({plugins:[b&&babelSugarFunctionalVue,c&&babelSugarInjectH,d&&babelSugarVModel,e&&babelSugarVOn,babelPluginTransformVueJsx].filter(Boolean)});module.exports=index;
|
||||
"use strict";function _interopDefault(a){return a&&"object"==typeof a&&"default"in a?a["default"]:a}var babelPluginTransformVueJsx=_interopDefault(require("@vue/babel-plugin-transform-vue-jsx")),babelSugarFunctionalVue=_interopDefault(require("@vue/babel-sugar-functional-vue")),babelSugarInjectH=_interopDefault(require("@vue/babel-sugar-inject-h")),babelSugarCompositionApiInjectH=_interopDefault(require("@vue/babel-sugar-composition-api-inject-h")),babelSugarCompositionApiRenderInstance=_interopDefault(require("@vue/babel-sugar-composition-api-render-instance")),babelSugarVModel=_interopDefault(require("@vue/babel-sugar-v-model")),babelSugarVOn=_interopDefault(require("@vue/babel-sugar-v-on")),index=(a,{functional:b=!0,injectH:c=!0,vModel:d=!0,vOn:e=!0,compositionAPI:f=!1}={})=>{let g=babelSugarInjectH,h="@vue/composition-api";if(f){if(("native"===f||"naruto"===f)&&(h="vue"),"auto"===f||!0===f)try{const a=require("vue/package.json").version;a.startsWith("2.7")&&(h="vue")}catch(a){}g=[babelSugarCompositionApiInjectH,{importSource:h}]}return{plugins:[b&&babelSugarFunctionalVue,c&&g,d&&babelSugarVModel,e&&babelSugarVOn,f&&[babelSugarCompositionApiRenderInstance,{importSource:h}],babelPluginTransformVueJsx].filter(Boolean)}};module.exports=index;
|
||||
|
||||
+31
-20
@@ -1,44 +1,46 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@vue/babel-preset-jsx@1.1.2",
|
||||
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
|
||||
"@vue/babel-preset-jsx@1.3.0",
|
||||
"/home/node/nuxt"
|
||||
]
|
||||
],
|
||||
"_from": "@vue/babel-preset-jsx@1.1.2",
|
||||
"_id": "@vue/babel-preset-jsx@1.1.2",
|
||||
"_from": "@vue/babel-preset-jsx@1.3.0",
|
||||
"_id": "@vue/babel-preset-jsx@1.3.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-zDpVnFpeC9YXmvGIDSsKNdL7qCG2rA3gjywLYHPCKDT10erjxF4U+6ay9X6TW5fl4GsDlJp9bVfAVQAAVzxxvQ==",
|
||||
"_integrity": "sha512-WFHjZWoUV/W0VAnEM/vi3zhdKsWrYf1TVFuxrpMQXVjhU8w8cxAUzNkmUDvf5iugCNzQssTJp9LjDPHAcmCqUw==",
|
||||
"_location": "/@vue/babel-preset-jsx",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@vue/babel-preset-jsx@1.1.2",
|
||||
"raw": "@vue/babel-preset-jsx@1.3.0",
|
||||
"name": "@vue/babel-preset-jsx",
|
||||
"escapedName": "@vue%2fbabel-preset-jsx",
|
||||
"scope": "@vue",
|
||||
"rawSpec": "1.1.2",
|
||||
"rawSpec": "1.3.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.2"
|
||||
"fetchSpec": "1.3.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@nuxt/babel-preset-app"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@vue/babel-preset-jsx/-/babel-preset-jsx-1.1.2.tgz",
|
||||
"_spec": "1.1.2",
|
||||
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
|
||||
"_resolved": "https://registry.npmjs.org/@vue/babel-preset-jsx/-/babel-preset-jsx-1.3.0.tgz",
|
||||
"_spec": "1.3.0",
|
||||
"_where": "/home/node/nuxt",
|
||||
"author": {
|
||||
"name": "Nick Messing",
|
||||
"email": "dot.nick.dot.messing@gmail.com"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
|
||||
"@vue/babel-plugin-transform-vue-jsx": "^1.1.2",
|
||||
"@vue/babel-sugar-functional-vue": "^1.1.2",
|
||||
"@vue/babel-sugar-inject-h": "^1.1.2",
|
||||
"@vue/babel-sugar-v-model": "^1.1.2",
|
||||
"@vue/babel-sugar-v-on": "^1.1.2"
|
||||
"@vue/babel-helper-vue-jsx-merge-props": "^1.2.1",
|
||||
"@vue/babel-plugin-transform-vue-jsx": "^1.2.1",
|
||||
"@vue/babel-sugar-composition-api-inject-h": "^1.3.0",
|
||||
"@vue/babel-sugar-composition-api-render-instance": "^1.3.0",
|
||||
"@vue/babel-sugar-functional-vue": "^1.2.2",
|
||||
"@vue/babel-sugar-inject-h": "^1.2.2",
|
||||
"@vue/babel-sugar-v-model": "^1.3.0",
|
||||
"@vue/babel-sugar-v-on": "^1.3.0"
|
||||
},
|
||||
"description": "Babel preset for Vue JSX",
|
||||
"devDependencies": {
|
||||
@@ -46,14 +48,23 @@
|
||||
"rollup-plugin-babel-minify": "^6.2.0"
|
||||
},
|
||||
"files": [],
|
||||
"gitHead": "67d6d39beab9f853118b4e0bbe901f5899ae7245",
|
||||
"gitHead": "f82f6182d294632a2cbddaacdff0a506c09e4ddc",
|
||||
"license": "MIT",
|
||||
"main": "dist/plugin.cjs.js",
|
||||
"name": "@vue/babel-preset-jsx",
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
"@babel/core": "^7.0.0-0",
|
||||
"vue": "2.x"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"vue": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vuejs/jsx/tree/master/packages/babel-preset-jsx"
|
||||
@@ -62,5 +73,5 @@
|
||||
"build": "rollup -c",
|
||||
"prerelease": "yarn build"
|
||||
},
|
||||
"version": "1.1.2"
|
||||
"version": "1.3.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user