You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/antd-tools/getBabelCommonConfig.js

54 lines
1.7 KiB

'use strict';
7 years ago
module.exports = function(modules) {
7 years ago
const plugins = [
[require.resolve('@vue/babel-plugin-jsx'), { mergeProps: false }],
require.resolve('@babel/plugin-proposal-optional-chaining'),
require.resolve('@babel/plugin-transform-object-assign'),
require.resolve('@babel/plugin-proposal-object-rest-spread'),
require.resolve('@babel/plugin-proposal-export-default-from'),
require.resolve('@babel/plugin-proposal-class-properties'),
require.resolve('@babel/plugin-syntax-dynamic-import'),
// require.resolve('babel-plugin-inline-import-data-uri'),
// require.resolve('@babel/plugin-transform-member-expression-literals'),
// require.resolve('@babel/plugin-transform-property-literals'),
// require.resolve('@babel/plugin-proposal-export-default-from'),
// require.resolve('@babel/plugin-transform-object-assign'),
// require.resolve('@babel/plugin-transform-template-literals'),
// require.resolve('@babel/plugin-proposal-object-rest-spread'),
// require.resolve('@babel/plugin-proposal-class-properties'),
];
plugins.push([
require.resolve('@babel/plugin-transform-runtime'),
{
helpers: false,
},
]);
7 years ago
return {
7 years ago
presets: [
[
require.resolve('@babel/preset-env'),
{
modules,
targets: {
browsers: [
'last 2 versions',
'Firefox ESR',
'> 1%',
'ie >= 11',
'iOS >= 8',
'Android >= 4',
],
},
7 years ago
},
],
7 years ago
],
7 years ago
plugins,
env: {
test: {
plugins: [require.resolve('babel-plugin-istanbul')],
},
},
};
};