vue.config.js 1008 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. const path = require('path');
  2. const common = path.resolve(__dirname, '../common');
  3. module.exports = {
  4. // 输出文件
  5. publicPath: `/${process.env.VUE_APP_ROUTER}`,
  6. // 打包文件
  7. outputDir: `${process.env.VUE_APP_ROUTER}`,
  8. // 静态资源
  9. assetsDir: 'static',
  10. lintOnSave: process.env.NODE_ENV === 'development',
  11. // 问题定位
  12. productionSourceMap: false,
  13. configureWebpack: (config) => {
  14. Object.assign(config, {
  15. resolve: {
  16. alias: {
  17. '@': path.resolve(__dirname, './src'),
  18. '@c': path.resolve(__dirname, './src/components'),
  19. '@a': path.resolve(__dirname, './src/assets'),
  20. '@common': common,
  21. },
  22. },
  23. });
  24. },
  25. devServer: {
  26. port: '8002',
  27. proxy: {
  28. [process.env.VUE_APP_BASE_URL_API]: {
  29. target: process.env.VUE_APP_REQUEST_URL,
  30. },
  31. [process.env.VUE_APP_BASE_API]: {
  32. target: process.env.VUE_APP_REQUEST_URL,
  33. changeOrigin: true,
  34. ws: false,
  35. },
  36. },
  37. },
  38. };