fix: @babel/runtime use v7.18+

This commit is contained in:
qiang 2022-11-30 17:59:24 +08:00
parent 6d8bddc41b
commit a3e327e2ee
2 changed files with 7 additions and 10 deletions

View File

@ -39,19 +39,12 @@ module.exports = (api, options, rootOptions) => {
] ]
api.extendPackage(pkg => { api.extendPackage(pkg => {
return { return {
dependencies: {
'regenerator-runtime': '^0.12.1',// 锁定版本,避免高版本在小程序中出错
'@dcloudio/uni-helper-json': '*'
},
devDependencies: { devDependencies: {
"@babel/runtime": "~7.17.9",// 临时指定版本7.13.x 会报错 '@dcloudio/uni-helper-json': '*',
'postcss-comment': '^2.0.0',
'@dcloudio/types': '^3.0.4', '@dcloudio/types': '^3.0.4',
'miniprogram-api-typings': '*', 'miniprogram-api-typings': '*',
'mini-types': '*' 'mini-types': '*',
}, 'postcss-comment': '^2.0.0'
resolutions: {
"@babel/runtime": "~7.17.9"
} }
} }
}) })

View File

@ -51,6 +51,10 @@ process.UNI_LIBRARIES.forEach(libraryName => {
]) ])
}) })
if (process.env.UNI_PLATFORM !== 'h5') {
plugins.push('@babel/plugin-transform-runtime')
}
const config = { const config = {
presets: [ presets: [
[ [