babel.config.js 588 B

123456789101112131415161718192021222324252627
  1. /*
  2. * @Description:
  3. * @Version: 1.0
  4. * @Autor: zhuyijun
  5. * @Date: 2021-11-21 14:34:40
  6. * @LastEditTime: 2022-02-17 14:29:22
  7. */
  8. //项目发布阶段需要用到的babel 插件
  9. const prodPlugins = []
  10. if (process.env.NODE_ENV === 'production') {
  11. prodPlugins.push('transform-remove-console')
  12. }
  13. module.exports = {
  14. presets: [
  15. '@vue/cli-plugin-babel/preset'
  16. ],
  17. plugins: [
  18. [
  19. 'component',
  20. {
  21. libraryName: 'element-ui',
  22. styleLibraryName: 'theme-chalk'
  23. }
  24. ],
  25. ...prodPlugins
  26. ]
  27. }