From e96d1bc68be3922acb6bed60fd1fae9665d0d05e Mon Sep 17 00:00:00 2001 From: ykforerlang <1527997464@qq.com> Date: Tue, 5 Nov 2019 15:01:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(alita):=20=E4=BF=AE=E5=A4=8Dtpyescript=20?= =?UTF-8?q?=E8=AF=AD=E6=B3=95=E5=A4=84=E7=90=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- rn-template/alita.config.js | 9 +++++++++ rn-typescript-template/alita.config.js | 9 +++++++++ src/util/uast.js | 4 ++-- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 rn-template/alita.config.js create mode 100644 rn-typescript-template/alita.config.js diff --git a/package.json b/package.json index bbe82a8..d9d21f5 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,8 @@ "@babel/plugin-syntax-jsx": "^7.0.0", "@babel/plugin-transform-react-jsx": "^7.1.6", "@babel/plugin-transform-runtime": "^7.5.0", + "@babel/plugin-transform-typescript": "^7.6.3", "@babel/preset-flow": "^7.0.0", - "@babel/preset-typescript": "^7.6.0", "@babel/traverse": "^7.1.6", "@babel/types": "^7.1.6", "babel-eslint": "^8.2.6", diff --git a/rn-template/alita.config.js b/rn-template/alita.config.js new file mode 100644 index 0000000..e470207 --- /dev/null +++ b/rn-template/alita.config.js @@ -0,0 +1,9 @@ +module.exports = { + dependencies: [ + { + name: '@areslabs/stringutil-rn', + wxName: '@areslabs/stringutil-wx', + wxVersion: '1.0.0' + } + ], +} \ No newline at end of file diff --git a/rn-typescript-template/alita.config.js b/rn-typescript-template/alita.config.js new file mode 100644 index 0000000..e470207 --- /dev/null +++ b/rn-typescript-template/alita.config.js @@ -0,0 +1,9 @@ +module.exports = { + dependencies: [ + { + name: '@areslabs/stringutil-rn', + wxName: '@areslabs/stringutil-wx', + wxVersion: '1.0.0' + } + ], +} \ No newline at end of file diff --git a/src/util/uast.js b/src/util/uast.js index e741bb5..5040113 100644 --- a/src/util/uast.js +++ b/src/util/uast.js @@ -39,8 +39,8 @@ const babelTransformJSX = babel.createConfigItem(require("../misc/transformJSX") const babelFlow = babel.createConfigItem(require("@babel/preset-flow"), {type: 'presets'}) -const babelTSX = babel.createConfigItem([require("@babel/plugin-syntax-typescript"), {isTSX: true}], {type: 'plugin'}) -const babelTS = babel.createConfigItem([require("@babel/plugin-syntax-typescript"), {isTSX: false}], {type: 'plugin'}) +const babelTSX = babel.createConfigItem([require("@babel/plugin-transform-typescript"), {isTSX: true}], {type: 'plugin'}) +const babelTS = babel.createConfigItem([require("@babel/plugin-transform-typescript"), {isTSX: false}], {type: 'plugin'}) const babelRestSpread = babel.createConfigItem([require("@babel/plugin-proposal-object-rest-spread"), { "loose": true, "useBuiltIns": true }]) const babelClassProperties = babel.createConfigItem([require("@babel/plugin-proposal-class-properties"), {"loose": true}])