| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import { resolve } from 'path'
- import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
- import react from '@vitejs/plugin-react'
- import tailwindcss from '@tailwindcss/vite'
- import { RENDERER_CSP } from './src/shared/csp'
- export default defineConfig({
- main: {
- plugins: [externalizeDepsPlugin()],
- build: {
- rollupOptions: {
- input: {
- index: resolve('src/main/index.ts'),
- 'steam-host': resolve('src/main/steam-host.ts')
- }
- }
- },
- resolve: {
- alias: {
- '@shared': resolve('src/shared')
- }
- }
- },
- preload: {
- plugins: [externalizeDepsPlugin()],
- build: {
- rollupOptions: {
- output: {
- format: 'cjs',
- entryFileNames: '[name].cjs'
- }
- }
- },
- resolve: {
- alias: {
- '@shared': resolve('src/shared')
- }
- }
- },
- renderer: {
- root: 'src/renderer',
- resolve: {
- alias: {
- '@renderer': resolve('src/renderer/src'),
- '@shared': resolve('src/shared')
- }
- },
- plugins: [
- react(),
- tailwindcss(),
- {
- name: 'renderer-csp',
- apply: 'build',
- transformIndexHtml: () => [
- { tag: 'meta', attrs: { 'http-equiv': 'Content-Security-Policy', content: RENDERER_CSP }, injectTo: 'head-prepend' }
- ]
- }
- ]
- }
- })
|