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

39 lines
1010 B

7 years ago
'use strict'
module.exports = function (modules) {
const plugins = [
7 years ago
require.resolve('babel-plugin-transform-vue-jsx'),
7 years ago
require.resolve('babel-plugin-transform-es3-member-expression-literals'),
require.resolve('babel-plugin-transform-es3-property-literals'),
require.resolve('babel-plugin-transform-object-assign'),
require.resolve('babel-plugin-transform-object-rest-spread'),
require.resolve('babel-plugin-transform-class-properties'),
7 years ago
]
7 years ago
plugins.push([require.resolve('babel-plugin-transform-runtime'), {
polyfill: false,
}])
7 years ago
return {
7 years ago
presets: [
[require.resolve('babel-preset-env'), {
modules,
targets: {
browsers: [
'last 2 versions',
'Firefox ESR',
'> 1%',
'ie >= 9',
'iOS >= 8',
'Android >= 4',
],
},
}],
],
7 years ago
plugins,
env: {
test: {
plugins: [require.resolve('babel-plugin-istanbul')],
},
},
7 years ago
}
}