babel.config.js 883 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * @Author: YLZH ylzh026611@163.com
  3. * @Date: 2022-11-15 10:41:18
  4. * @LastEditors: YLZH ylzh026611@163.com
  5. * @LastEditTime: 2023-03-30 15:41:44
  6. * @FilePath: \purchase\babel.config.js
  7. * @Description:
  8. *
  9. * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
  10. */
  11. const prodPlugins = [];
  12. if (process.env.NODE_ENV === "production") {
  13. prodPlugins.push("transform-remove-console");
  14. }
  15. module.exports = {
  16. presets: [
  17. // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
  18. "@vue/cli-plugin-babel/preset"
  19. ],
  20. plugins: [...prodPlugins],
  21. env: {
  22. development: {
  23. // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
  24. // This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
  25. plugins: ["dynamic-import-node"]
  26. }
  27. }
  28. };