From 2ee3e39c01ce60f7d07162a3065117d02873a53b Mon Sep 17 00:00:00 2001 From: qiyx2019 <1834362615@qq.com> Date: Mon, 30 Jan 2023 19:42:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=20declare=E5=87=BD=E6=95=B0=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E5=A2=9E=E5=BC=BAts=E7=B1=BB=E5=9E=8B=E6=8F=90?= =?UTF-8?q?=E7=A4=BA,=E4=BB=A5=E5=8F=8A=E6=8F=92=E4=BB=B6=E5=87=BA?= =?UTF-8?q?=E9=94=99=E6=97=B6=E8=83=BD=E5=A4=9F=E6=8F=90=E4=BE=9B=E6=9C=89?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/babel-plugin-uni-api/index.js | 6 +++--- package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/babel-plugin-uni-api/index.js b/lib/babel-plugin-uni-api/index.js index 8c41cb8c689..e665e096a03 100644 --- a/lib/babel-plugin-uni-api/index.js +++ b/lib/babel-plugin-uni-api/index.js @@ -1,5 +1,5 @@ const path = require('path') - +const { declare } = require('@babel/helper-plugin-utils'); const isWin = /^win/.test(process.platform) const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path) @@ -85,7 +85,7 @@ function parseExports(node, t, file) { } } -module.exports = function({ +module.exports = declare(function({ types: t }) { return { @@ -141,4 +141,4 @@ module.exports = function({ } } } -} +}) diff --git a/package.json b/package.json index 32dab8d490c..f59f0d9d15c 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ }, "private": true, "devDependencies": { + "@babel/helper-plugin-utils": "^7.20.2", "@rollup/plugin-alias": "^3.1.0", "@rollup/plugin-commonjs": "^11.1.0", "@rollup/plugin-json": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index 623212d5e0e..6e8294f6db2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -157,6 +157,11 @@ version "7.8.3" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670" +"@babel/helper-plugin-utils@^7.20.2": + version "7.20.2" + resolved "https://registry.npmmirror.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" + integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== + "@babel/helper-regex@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.8.3.tgz#139772607d51b93f23effe72105b319d2a4c6965"