From d76049339d879910ce91a93774c60da0fb90ebc9 Mon Sep 17 00:00:00 2001 From: lihong Date: Tue, 27 Sep 2022 11:32:59 +0000 Subject: [PATCH] =?UTF-8?q?fixed=20f0ef0ed=20from=20https://gitee.com/liho?= =?UTF-8?q?ng67/third=5Fparty=5Fweex-loader/pulls/112=20=E5=9B=9E=E9=80=80?= =?UTF-8?q?=20'Pull=20Request=20!106=20:=20js=E4=B8=ADasync=20await?= =?UTF-8?q?=E7=89=87=E6=AE=B5=E4=B8=8D=E8=BD=AC=E5=8C=96es5=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/loader.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/loader.js b/src/loader.js index 123d733..2f41b82 100644 --- a/src/loader.js +++ b/src/loader.js @@ -128,17 +128,13 @@ 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: isTargets, + query: { + presets: [loadBabelModule('@babel/preset-env')], + plugins: [loadBabelModule('@babel/plugin-transform-modules-commonjs')], + comments: 'false' + } }) loaders.push({ name: defaultLoaders.resourceReferenceScript -- Gitee