vue.config.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. module.exports = {
  2. lintOnSave: false,
  3. runtimeCompiler: true,
  4. devServer: {
  5. host:'0.0.0.0',
  6. port: 8002,
  7. open: true,
  8. hot:true,
  9. disableHostCheck: true,
  10. overlay: {
  11. warnings: false,
  12. errors: true
  13. },
  14. // before: require('./mock/mock-server.js')
  15. proxy: {
  16. // change xxx-api/login => mock/login
  17. // detail: https://cli.vuejs.org/config/#devserver-proxy
  18. '/api':{
  19. changeOrigin: true, // //开启代理:在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样客户端端和服务端进行数据的交互就不会有跨域问题
  20. pathRewrite: { //// 思路是如果是开发环境,就给所有要代理的接口统一加上前缀,然后代理请求时再统一通过rewrite去掉
  21. '^api': ''
  22. },
  23. target: 'http://121.40.93.243:8003/',
  24. }
  25. },
  26. },
  27. publicPath:"./",
  28. configureWebpack: {
  29. //Necessary to run npm link https://webpack.js.org/configuration/resolve/#resolve-symlinks
  30. resolve: {
  31. symlinks: false
  32. },
  33. },
  34. transpileDependencies: [
  35. '@coreui/utils',
  36. '@coreui/vue'
  37. ]
  38. }