vite.config.js 706 B

123456789101112131415161718192021222324252627282930
  1. import { defineConfig } from 'vite'
  2. import Unocss from 'unocss/vite'
  3. import { svelte } from '@sveltejs/vite-plugin-svelte'
  4. import { internalIpV4 } from 'internal-ip'
  5. // https://vitejs.dev/config/
  6. export default defineConfig(async ({ command, mode }) => {
  7. const host = await internalIpV4()
  8. return {
  9. plugins: [Unocss(), svelte()],
  10. build: {
  11. rollupOptions: {
  12. output: {
  13. entryFileNames: `assets/[name].js`,
  14. chunkFileNames: `assets/[name].js`,
  15. assetFileNames: `assets/[name].[ext]`
  16. }
  17. }
  18. },
  19. server: {
  20. hmr: {
  21. host,
  22. port: 5183
  23. },
  24. fs: {
  25. allow: ['.', '../../tooling/api/dist']
  26. }
  27. }
  28. }
  29. })