babel.config.js 516 B

1234567891011121314151617181920212223
  1. const plugins = [
  2. '@babel/plugin-syntax-dynamic-import',
  3. '@babel/plugin-transform-runtime'
  4. ]
  5. if (process.env.NODE_ENV === 'production') {
  6. plugins.push('transform-remove-console')
  7. }
  8. module.exports = {
  9. presets: [
  10. [
  11. '@vue/cli-plugin-babel/preset',
  12. {
  13. useBuiltIns: 'entry', // 推荐使用 'entry' 而非 'usage' 确保完全覆盖
  14. corejs: 3, // 使用 core-js@3 版本
  15. targets: {
  16. ie: '11' // 明确指定 IE11 为目标
  17. }
  18. }
  19. ]
  20. ],
  21. plugins
  22. }