vue.config.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
  13. productionSourceMap: false,
  14. /*
  15. pages: {
  16. index: {
  17. entry: 'src/main.js',
  18. chunks: ['chunk-vendors', 'chunk-common', 'index']
  19. }
  20. },
  21. */
  22. configureWebpack: {},
  23. chainWebpack: (config) => {
  24. config.resolve.alias
  25. .set('@$', resolve('src'))
  26. .set('@api', resolve('src/api'))
  27. .set('@assets', resolve('src/assets'))
  28. .set('@comp', resolve('src/components'))
  29. .set('@views', resolve('src/views'))
  30. .set('@layout', resolve('src/layout'))
  31. .set('@static', resolve('src/static'))
  32. },
  33. css: {
  34. loaderOptions: {
  35. less: {
  36. modifyVars: {
  37. /* less 变量覆盖,用于自定义 ant design 主题 */
  38. /*
  39. 'primary-color': '#F5222D',
  40. 'link-color': '#F5222D',
  41. 'border-radius-base': '4px',
  42. */
  43. },
  44. javascriptEnabled: true,
  45. }
  46. }
  47. },
  48. devServer: {
  49. port: 3000,
  50. proxy: {
  51. /* '/api': {
  52. target: 'https://mock.ihx.me/mock/5baf3052f7da7e07e04a5116/antd-pro', //mock API接口系统
  53. ws: false,
  54. changeOrigin: true,
  55. pathRewrite: {
  56. '/jeecg-boot': '' //默认所有请求都加了jeecg-boot前缀,需要去掉
  57. }
  58. },*/
  59. '/jeecg-boot': {
  60. target: 'http://localhost:8080', //请求本地 需要jeecg-boot后台项目
  61. ws: false,
  62. changeOrigin: true
  63. },
  64. }
  65. },
  66. lintOnSave: undefined
  67. }