vite.config.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. const { resolve } = require('path')
  2. import vue from '@vitejs/plugin-vue'
  3. import { defineConfig } from 'vite'
  4. import glsl from 'vite-plugin-glsl'
  5. const vueJsx = require('@vitejs/plugin-vue-jsx')
  6. const legacy = require('@vitejs/plugin-legacy')
  7. const proxyUrl = 'https://test.lexiaoya.cn/' // test 环境
  8. // const proxyUrl = 'http://192.168.3.70:8989/' // test 环境
  9. // const proxyUrl = 'https://online.colexiu.com/' // online 环境
  10. // const proxyUrl = 'https://online.lexiaoya.cn/' // online 环境
  11. export default defineConfig({
  12. base: '/orchestra-music-score',
  13. build: {
  14. rollupOptions: {
  15. input: {
  16. index: resolve(__dirname, 'index.html'),
  17. orchestra: resolve(__dirname, 'orchestra.html'),
  18. colexiu: resolve(__dirname, 'colexiu.html'),
  19. 'colexiu-report-share': resolve(__dirname, 'colexiu-report-share.html'),
  20. 'colexiu-report': resolve(__dirname, 'colexiu-report.html'),
  21. 'colxiu-website': resolve(__dirname, 'colxiu-website.html'),
  22. 'colxiu-share': resolve(__dirname, 'colexiu-share.html'),
  23. 'music-sheet': resolve(__dirname, 'music-sheet.html'),
  24. },
  25. },
  26. },
  27. plugins: [
  28. vue(),
  29. glsl(),
  30. vueJsx(),
  31. legacy({
  32. targets: ['> 0.25%, not dead'],
  33. ignoreBrowserslistConfig: true,
  34. }),
  35. ],
  36. server: {
  37. port: 3000,
  38. cors: true,
  39. proxy: {
  40. '/api-student': {
  41. target: proxyUrl,
  42. changeOrigin: true,
  43. },
  44. '/api-teacher': {
  45. target: proxyUrl,
  46. changeOrigin: true,
  47. },
  48. '/api-backend': {
  49. target: proxyUrl,
  50. changeOrigin: true,
  51. }
  52. },
  53. },
  54. preview: {
  55. port: 3000,
  56. host: '192.168.3.114'
  57. }
  58. })