babel.config.js 602 B

1234567891011121314151617181920212223242526272829
  1. const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
  2. const plugins = []
  3. if (IS_PROD) {
  4. plugins.push('transform-remove-console')
  5. plugins.push("@babel/plugin-transform-runtime")
  6. }
  7. module.exports = {
  8. presets: [
  9. '@vue/app',
  10. [
  11. '@babel/preset-env',
  12. {
  13. 'useBuiltIns': 'entry'
  14. }
  15. ]
  16. ],
  17. plugins
  18. // if your use import on Demand, Use this code
  19. // ,
  20. // plugins: [
  21. // [ 'import', {
  22. // 'libraryName': 'ant-design-vue',
  23. // 'libraryDirectory': 'es',
  24. // 'style': true // `style: true` 会加载 less 文件
  25. // } ]
  26. // ]
  27. }