vue.config.js 872 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. const { defineConfig } = require('@vue/cli-service')
  2. module.exports = defineConfig({
  3. // build编译后不生成资源MAP文件
  4. productionSourceMap: false,
  5. lintOnSave: false,
  6. //开发服务,build后的生产模式还需nginx代理
  7. devServer: {
  8. allowedHosts: 'all',
  9. open: false, //运行后自动打开浏览器
  10. port: 1988, //挂载端口
  11. proxy: {
  12. '/api': {
  13. target: "http://127.0.0.1:1881/web/",
  14. ws: true,
  15. changeOrigin: true,
  16. pathRewrite: {
  17. '^/api': '/'
  18. }
  19. }
  20. }
  21. },
  22. configureWebpack: {
  23. //性能提示
  24. performance: {
  25. hints: false
  26. },
  27. optimization: {
  28. splitChunks: {
  29. chunks: "all",
  30. automaticNameDelimiter: '~',
  31. name: "webChunks",
  32. cacheGroups: {
  33. //第三方库抽离
  34. vendor: {
  35. name: "modules",
  36. test: /[\\/]node_modules[\\/]/,
  37. priority: -10
  38. }
  39. }
  40. }
  41. }
  42. }
  43. })