!106 js中async await片段不转化es5代码配置修改

Merge pull request !106 from Bo Jiang/master
This commit is contained in:
openharmony_ci 2022-09-22 02:58:24 +00:00 committed by Gitee
commit 35df3d3507
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -128,13 +128,17 @@ function scriptLoaderString (loaders, config, customLoader) {
loaders = loaders.concat(customLoader)
}
else {
const isTargets = {
presets: [loadBabelModule('@babel/preset-env')],
plugins: [loadBabelModule('@babel/plugin-transform-modules-commonjs')],
comments: 'false'
}
if (process.env.DEVICE_LEVEL === DEVICE_LEVEL.RICH) {
isTargets['targets'] = 'node 14';
}
loaders.push({
name: defaultLoaders.babel,
query: {
presets: [loadBabelModule('@babel/preset-env')],
plugins: [loadBabelModule('@babel/plugin-transform-modules-commonjs')],
comments: 'false'
}
query: isTargets,
})
loaders.push({
name: defaultLoaders.resourceReferenceScript