vue.config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const path = require('path');
  2. module.exports = {
  3. publicPath: `/${process.env.BASE_URL}`,
  4. // 打包文件
  5. outputDir: 'umychart',
  6. productionSourceMap: false,
  7. configureWebpack: (config) => {
  8. Object.assign(config, {
  9. // 开发生产共同配置
  10. resolve: {
  11. alias: {
  12. '@': path.resolve(__dirname, './src'),
  13. '@c': path.resolve(__dirname, './src/components'),
  14. '@a': path.resolve(__dirname, './src/assets'),
  15. },
  16. },
  17. });
  18. },
  19. css: {
  20. loaderOptions: {
  21. less: {
  22. globalVars: {
  23. hack: `true; @import '~@/assets/less/var.less';`,
  24. },
  25. },
  26. },
  27. },
  28. devServer: {
  29. port: '8001',
  30. //api地址前缀
  31. // proxy: {
  32. // '/hqserver': {
  33. // target: 'https://www.ilikegou.cn', //http://192.168.1.19:9101
  34. // changeOrigin: true,
  35. // ws: false,
  36. // // pathRewrite: {
  37. // // // 路径重写
  38. // // '/api': '', // 这个意思就是以api开头的,定向到哪里, 如果你的后边还有路径的话, 会自动拼接上
  39. // // },
  40. // },
  41. // },
  42. },
  43. };