vue.config.js 990 B

1234567891011121314151617181920212223242526272829303132
  1. module.exports = {
  2. outputDir: "shenze",
  3. publicPath: "/shenze",
  4. // publicPath: '/sunzee-stock',
  5. assetsDir: "static",
  6. css: {
  7. extract: false,
  8. },
  9. filenameHashing: true,
  10. configureWebpack: {
  11. output: {
  12. filename: "[name].[hash].js",
  13. chunkFilename: "[id].[hash].chunk.js",
  14. },
  15. },
  16. devServer: {
  17. open: true,
  18. proxy: {
  19. "/": {
  20. target: 'http://120.25.151.99:49022', // 代理地址,这里设置的地址会代替axios中设置的baseURL
  21. // target: "http://120.25.151.99:49011",
  22. // target: 'http://112.74.63.148:49011',
  23. // secure: true, // 使用的是http协议设置为 false,https协议设置为 true
  24. changeOrigin: true, // 是否跨域
  25. pathRewrite: {
  26. // '.+?/api': '/api' // 对反向代理的地址进行重写,因为正确的接口路径是没有/api的,所以需要用'^/api': '/',表示请求接口时去掉api
  27. },
  28. },
  29. },
  30. disableHostCheck: true,
  31. },
  32. };