vue.config.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. const { resolve } = require('path')
  2. const { VantResolver } = require('unplugin-vue-components/resolvers')
  3. const ComponentsPlugin = require('unplugin-vue-components/webpack')
  4. module.exports = {
  5. publicPath: '/app_web', // 打包后资源访问路径
  6. lintOnSave: false, // eslint是否在保存的时候检查
  7. pages: {
  8. index: {
  9. entry: 'src/main.ts', // page 的入口
  10. template: 'public/index.html', // 模板来源
  11. filename: 'index.html' // 在 dist/index.html 的输出
  12. },
  13. demo: {
  14. entry: 'src/pages/demo/main.ts',
  15. template: 'src/pages/demo/public/index.html',
  16. filename: 'demo.html'
  17. },
  18. LearnPlan: {
  19. entry: 'src/pages/LearnPlan/main.ts',
  20. template: 'src/pages/LearnPlan/public/index.html',
  21. filename: 'learn-plan.html'
  22. },
  23. SectionAudition: {
  24. entry: 'src/pages/SectionAudition/main.ts',
  25. template: 'src/pages/SectionAudition/public/index.html',
  26. filename: 'section-audition.html'
  27. },
  28. DownloadApp: {
  29. entry: 'src/pages/DownloadApp/main.ts',
  30. template: 'src/pages/DownloadApp/public/index.html',
  31. filename: 'download-app.html'
  32. },
  33. DownloadAppParent: {
  34. entry: 'src/pages/DownloadAppParent/main.ts',
  35. template: 'src/pages/DownloadAppParent/public/index.html',
  36. filename: 'download-app-parent.html'
  37. },
  38. Course: {
  39. entry: 'src/pages/Course/main.ts',
  40. template: 'src/pages/Course/public/index.html',
  41. filename: 'course.html'
  42. },
  43. LP: {
  44. entry: 'src/pages/LearnPlanActive/main.ts',
  45. template: 'src/pages/LearnPlanActive/public/index.html',
  46. filename: 'lp.html'
  47. },
  48. pay: {
  49. entry: 'src/pages/Pay/main.ts',
  50. template: 'src/pages/Pay/public/index.html',
  51. filename: 'pay.html'
  52. },
  53. pay: {
  54. entry: 'src/pages/CollectCourses/main.ts',
  55. template: 'src/pages/CollectCourses/public/index.html',
  56. filename: 'collect-courses.html'
  57. },
  58. },
  59. chainWebpack: config => {
  60. config.resolve.alias
  61. .set('@', resolve('src'))
  62. .set('@hook', resolve('src/hook'))
  63. .set('@demo', resolve('src/pages/demo/src'))
  64. .set('@LP', resolve('src/pages/LearnPlan'))
  65. },
  66. configureWebpack: {
  67. plugins: [
  68. ComponentsPlugin({
  69. resolvers: [VantResolver()]
  70. })
  71. ]
  72. },
  73. devServer: {
  74. proxy: {
  75. '/api/': {
  76. target: 'http://local.luojigou.vip:8888/',
  77. ws: false,
  78. secure: false,
  79. changeOrigin: true,
  80. pathRewrite: {
  81. '^/api/': ''
  82. }
  83. },
  84. '/zd-api/': {
  85. // target: 'https://open.test.luojigou.vip/', // 开发环境
  86. // target: 'https://open.api.luojigou.vip/', // 生产环境
  87. target: 'http://192.168.1.105:8083/', // 生产环境
  88. ws: false,
  89. secure: false,
  90. changeOrigin: true,
  91. pathRewrite: {
  92. '^/zd-api/': ''
  93. }
  94. }
  95. }
  96. }
  97. }