vue.config.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. const path = require('path');
  2. const mobileSrc = path.resolve(__dirname, '../web-mobile/src');
  3. module.exports = {
  4. publicPath: process.env.NODE_ENV === 'development' ? './' : process.env.VUE_APP_ROUTER,
  5. pages: {
  6. index: 'src/pages/corp/main.js',
  7. },
  8. configureWebpack: config => {
  9. Object.assign(config, {
  10. // 开发生产共同配置
  11. resolve: {
  12. alias: {
  13. '@': path.resolve(__dirname, './src'),
  14. '@c': path.resolve(__dirname, './src/components'),
  15. '@a': path.resolve(__dirname, './src/assets'),
  16. '@m': mobileSrc,
  17. },
  18. },
  19. });
  20. },
  21. // css: {
  22. // loaderOptions: {
  23. // css: {
  24. // data: `@import "./src/style/nutui.css";@import "@nutui/nutui/dist/styles/index.css";`,
  25. // },
  26. // },
  27. // },
  28. devServer: {
  29. port: '8006',
  30. //api地址前缀
  31. proxy: {
  32. '/api': {
  33. target: 'http://smart.cc-lotus.info',
  34. changeOrigin: true,
  35. ws: true,
  36. },
  37. '/wxtoken': {
  38. target: 'http://smart.cc-lotus.info/weixin',
  39. changeOrigin: true,
  40. ws: true,
  41. pathRewrite: {
  42. '^/wxtoken': 'http://localhost:8005',
  43. },
  44. },
  45. '/files': {
  46. target: 'http://smart.cc-lotus.info',
  47. changeOrigin: true,
  48. ws: true,
  49. },
  50. },
  51. },
  52. };