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"