Signed-off-by: bojiang <jiangbo91@huawei.com>
Change-Id: Ifdfd14e6733cd149c196b8a21db8b2e9a0e72478
This commit is contained in:
bojiang 2022-11-01 15:47:02 +08:00
parent 506088708e
commit cbefaf2c1a

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 8';
}
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