vue.config.js 806 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. const path = require('path')
  2. function resolve(dir) {
  3. return path.join(__dirname, dir)
  4. }
  5. // vue.config.js
  6. module.exports = {
  7. chainWebpack: (config) => {
  8. config.resolve.alias
  9. .set('@', resolve('src'))
  10. },
  11. css: {
  12. loaderOptions: {
  13. less: {
  14. modifyVars: {
  15. red: '#f44',
  16. blue: '#1989fa',
  17. orange: '#e9ca32',
  18. green: "#07c160",
  19. 'text-color': '#333'
  20. },
  21. }
  22. }
  23. },
  24. devServer: {
  25. port: 8081, // 端口号
  26. https: false, //https:{type:Boolean}
  27. open: true, //配置自动启动浏览器
  28. proxy: {
  29. '/gateway': {
  30. target: 'http://192.168.0.109:9007',
  31. ws: false,
  32. changeOrigin: true,
  33. // pathRewrite: {
  34. // '^/gateway': '/api'
  35. // }
  36. }
  37. }
  38. },
  39. }