electron.vite.config.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { resolve } from 'path'
  2. import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
  3. import react from '@vitejs/plugin-react'
  4. import tailwindcss from '@tailwindcss/vite'
  5. export default defineConfig({
  6. main: {
  7. plugins: [externalizeDepsPlugin()],
  8. build: {
  9. rollupOptions: {
  10. input: {
  11. index: resolve('src/main/index.ts'),
  12. 'steam-host': resolve('src/main/steam-host.ts')
  13. }
  14. }
  15. },
  16. resolve: {
  17. alias: {
  18. '@shared': resolve('src/shared')
  19. }
  20. }
  21. },
  22. preload: {
  23. plugins: [externalizeDepsPlugin()],
  24. build: {
  25. rollupOptions: {
  26. output: {
  27. format: 'cjs',
  28. entryFileNames: '[name].cjs'
  29. }
  30. }
  31. },
  32. resolve: {
  33. alias: {
  34. '@shared': resolve('src/shared')
  35. }
  36. }
  37. },
  38. renderer: {
  39. root: 'src/renderer',
  40. resolve: {
  41. alias: {
  42. '@renderer': resolve('src/renderer/src'),
  43. '@shared': resolve('src/shared')
  44. }
  45. },
  46. plugins: [react(), tailwindcss()]
  47. }
  48. })