vite.config.js 581 B

123456789101112131415161718192021
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import topLevelAwait from 'vite-plugin-top-level-await'
  4. // https://vitejs.dev/config/
  5. export default defineConfig({
  6. server: {
  7. port: 3000
  8. },
  9. css: [
  10. "../../assets/iconfont/iconfont.css"
  11. ],
  12. plugins: [
  13. vue(),
  14. topLevelAwait({
  15. // The export name of top-level await promise for each chunk module
  16. promiseExportName: '__tla',
  17. // The function to generate import names of top-level await promise in each chunk module
  18. promiseImportName: i => `__tla_${i}`
  19. })
  20. ],
  21. })