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 => {
return {
dependencies: {
'regenerator-runtime': '^0.12.1',// 锁定版本,避免高版本在小程序中出错
'@dcloudio/uni-helper-json': '*'
},
devDependencies: {
"@babel/runtime": "~7.17.9",// 临时指定版本7.13.x 会报错
'postcss-comment': '^2.0.0',
'@dcloudio/uni-helper-json': '*',
'@dcloudio/types': '^3.0.4',
'miniprogram-api-typings': '*',
'mini-types': '*'
},
resolutions: {
"@babel/runtime": "~7.17.9"
'mini-types': '*',
'postcss-comment': '^2.0.0'
}
}
})

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 = {
presets: [
[