vue.config.js 787B

1234567891011121314151617181920212223242526272829303132
  1. // vue.config.js
  2. // vue.config.js
  3. const path = require('path')
  4. const resolve = dir => path.join(__dirname, dir)
  5. module.exports = {
  6. devServer: {
  7. proxy: {
  8. '/api': {
  9. target: "http://192.168.89.147:8080/",
  10. // ws: true,
  11. changeOrigin: true,
  12. // pathRewrite: {
  13. // // 路径重写
  14. // "/api": "" // 这个意思就是以api开头的,定向到哪里, 如果你的后边还有路径的话, 会自动拼接上
  15. // }
  16. },
  17. },
  18. },
  19. lintOnSave: false,
  20. publicPath: "./",//在vue-cli.3.3版本后 baseUrl被废除了,因此这边要写成 publicPath。 https://cli.vuejs.org/zh/config/#vue-config-js
  21. runtimeCompiler: true,
  22. chainWebpack: config => {
  23. config.resolve.alias.set("@", resolve("src"));
  24. }
  25. }