babel.config.js 537 B

12345678910111213141516171819202122
  1. /*
  2. * @FilePath: babel.config.js
  3. * @Author: 阿小凉
  4. * @Date: 2022-09-06 17:31:51
  5. * @LastEditors: 阿小凉
  6. * @LastEditTime: 2024-03-14 16:44:53
  7. * @Description:
  8. */
  9. let transformRemoveConsolePlugin = []
  10. //判断是开发还是发布阶段
  11. if (process.env.ENV === 'online') {
  12. transformRemoveConsolePlugin = ['transform-remove-console']
  13. }
  14. module.exports = {
  15. presets: ['@vue/cli-plugin-babel/preset'],
  16. env: {
  17. development: {
  18. plugins: ['dynamic-import-node'],
  19. },
  20. },
  21. plugins: [...transformRemoveConsolePlugin],
  22. }