mirror of
https://gitee.com/openharmony/developtools_ace_js2bundle
synced 2024-11-27 01:20:27 +00:00
commit
da0f990e3e
@ -18,20 +18,26 @@ module.exports = function(api) {
|
||||
|
||||
const presets = ['@babel/preset-env'];
|
||||
const plugins = [
|
||||
[
|
||||
'@babel/plugin-transform-modules-commonjs',
|
||||
{'allowTopLevelThis': true}
|
||||
],
|
||||
'@babel/plugin-proposal-class-properties',
|
||||
'@babel/plugin-transform-runtime',
|
||||
];
|
||||
if (process.env.DEVICE_LEVEL === 'lite') {
|
||||
plugins.push([
|
||||
const liteArray = [
|
||||
'@babel/plugin-transform-runtime',
|
||||
[
|
||||
'@babel/plugin-transform-arrow-functions',
|
||||
{
|
||||
spec: true,
|
||||
},
|
||||
]);
|
||||
{spec: true},
|
||||
]
|
||||
]
|
||||
plugins.push(...liteArray);
|
||||
}
|
||||
return {
|
||||
presets,
|
||||
plugins,
|
||||
comments: false
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -93,8 +93,13 @@ const richModule = {
|
||||
options: {
|
||||
presets: [util.loadBabelModule('@babel/preset-env')],
|
||||
targets: 'node 8',
|
||||
plugins: [util.loadBabelModule('@babel/plugin-transform-modules-commonjs'),
|
||||
util.loadBabelModule('@babel/plugin-proposal-class-properties')],
|
||||
plugins: [
|
||||
[
|
||||
util.loadBabelModule('@babel/plugin-transform-modules-commonjs'),
|
||||
{'allowTopLevelThis': true}
|
||||
],
|
||||
util.loadBabelModule('@babel/plugin-proposal-class-properties')
|
||||
],
|
||||
compact: false
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user