金币系统前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1007 B

1 month ago
4 months ago
1 month ago
1 month ago
1 month ago
1 month ago
4 months ago
1 month ago
  1. import { defineConfig, loadEnv } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import { lazyImport, VxeResolver } from 'vite-plugin-lazy-import'
  4. import legacy from '@vitejs/plugin-legacy'
  5. import path from 'path'
  6. // https://vite.dev/config/
  7. export default defineConfig(({ mode }) => {
  8. const env = loadEnv(mode, process.cwd())
  9. console.log('当前环境:', mode)
  10. console.log('当前环境变量:', env)
  11. return {
  12. esbuild: {
  13. supported: {
  14. bigint: true
  15. }
  16. },
  17. plugins: [
  18. vue(),
  19. legacy({
  20. targets: ['defaults', 'not IE 11', 'chrome >=73'],
  21. modernPolyfills: true
  22. }),
  23. lazyImport({
  24. resolvers: [
  25. VxeResolver({
  26. libraryName: 'vxe-table'
  27. }),
  28. VxeResolver({
  29. libraryName: 'vxe-pc-ui'
  30. })
  31. ]
  32. })
  33. ],
  34. resolve: {
  35. alias: {
  36. '@': path.resolve(__dirname, './src')
  37. }
  38. },
  39. base: process.env.NODE_ENV === 'production' ? './' : '/'
  40. }
  41. })