vue.config.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. const path = require('path')
  2. function resolve(dir) {
  3. return path.join(__dirname, dir)
  4. }
  5. // vue.config.js
  6. module.exports = {
  7. /*
  8. Vue-cli3:
  9. Crashed when using Webpack `import()` #2463
  10. https://github.com/vuejs/vue-cli/issues/2463
  11. */
  12. /*
  13. pages: {
  14. index: {
  15. entry: 'src/main.js',
  16. chunks: ['chunk-vendors', 'chunk-common', 'index']
  17. }
  18. },
  19. */
  20. configureWebpack: {},
  21. chainWebpack: (config) => {
  22. config.resolve.alias
  23. .set('@$', resolve('src'))
  24. .set('@api', resolve('src/api'))
  25. .set('@assets', resolve('src/assets'))
  26. .set('@comp', resolve('src/components'))
  27. .set('@views', resolve('src/views'))
  28. .set('@layout', resolve('src/layout'))
  29. .set('@static', resolve('src/static'))
  30. },
  31. css: {
  32. loaderOptions: {
  33. less: {
  34. modifyVars: {
  35. /* less 变量覆盖,用于自定义 ant design 主题 */
  36. /*
  37. 'primary-color': '#F5222D',
  38. 'link-color': '#F5222D',
  39. 'border-radius-base': '4px',
  40. */
  41. },
  42. javascriptEnabled: true,
  43. }
  44. }
  45. },
  46. devServer: {
  47. port: 3000,
  48. proxy: {
  49. /* '/api': {
  50. target: 'https://mock.ihx.me/mock/5baf3052f7da7e07e04a5116/antd-pro', //mock API接口系统
  51. ws: false,
  52. changeOrigin: true,
  53. pathRewrite: {
  54. '/jeecg-boot': '' //默认所有请求都加了jeecg-boot前缀,需要去掉
  55. }
  56. },*/
  57. '/jeecg-boot': {
  58. target: 'http://localhost:8080', //请求本地 需要jeecg-boot后台项目
  59. ws: false,
  60. changeOrigin: true
  61. },
  62. }
  63. },
  64. lintOnSave: undefined
  65. }