vue.config.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. const { defineConfig } = require('@vue/cli-service')
  2. const baseUrl = require('./src/utils/baseUrl.js')
  3. module.exports = defineConfig({
  4. transpileDependencies: true,
  5. lintOnSave: false,
  6. // baseUrl: BASE_URL,
  7. // chainWebpack: config => {
  8. // config.resolve.alias
  9. // .set('@', resolve('src'))
  10. // .set('_c', resolve('src/components'))
  11. // .set('_conf', resolve('config'))
  12. // },
  13. publicPath: '/',
  14. configureWebpack: {
  15. externals: {
  16. 'fs': require('fs')
  17. }
  18. },
  19. devServer: {
  20. port: 8090,
  21. proxy: process.env.NODE_ENV === "development" ? {
  22. [baseUrl.ROOT]: {
  23. target: baseUrl.URL,
  24. // target: 'http://192.168.2.4:8086',
  25. changeOrigin: true,
  26. ws: false,
  27. pathRewrite: {
  28. // '^/api': ''
  29. [`^${baseUrl.ROOT}`]: ''
  30. }
  31. }
  32. // '/api': {
  33. // target: 'http://120.46.129.85:8086',
  34. // // target: 'http://192.168.2.4:8086',
  35. // changeOrigin: true,
  36. // ws: false,
  37. // pathRewrite: {
  38. // '^/api': ''
  39. // }
  40. // }
  41. } : baseUrl.ROOT
  42. }
  43. })