- Changed development port for studio-panel from 3001 to 3020 in package.json and vite.config.ts. - Refactored Studio component in studio-panel to improve token handling and error diagnostics. - Added utility functions for token validation and JWT decoding in Studio component. - Enhanced error handling and user feedback in Studio component when token is invalid. - Implemented sessionStorage management for token and server URL in Studio component. - Created Docker setup for broadcast-panel including Dockerfile, Dockerfile.dev, and docker-compose.yml. - Added Nginx configuration for serving the broadcast-panel as a Single Page Application. - Introduced Banner component in broadcast-panel for displaying messages and actions. - Added start-docker.sh script for easy Docker management of broadcast-panel. - Implemented Playwright E2E tests for token handling and UI interactions between broadcast-panel and studio-panel. - Included SSL certificates for local development in studio-panel.
55 lines
2.2 KiB
TypeScript
55 lines
2.2 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
optimizeDeps: {
|
|
include: [
|
|
'react-icons',
|
|
'react-icons/si',
|
|
'react-icons/md',
|
|
'react-icons/fa',
|
|
'react-icons/fa6',
|
|
'react-icons/bs'
|
|
]
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
'@shared': process.env.DOCKER_ENV ? '/shared' : path.resolve(__dirname, '../../shared'),
|
|
'@avanzacast/shared-hooks': process.env.DOCKER_ENV ? '/shared/hooks' : path.resolve(__dirname, '../../shared/hooks'),
|
|
'@avanzacast/shared-utils': process.env.DOCKER_ENV ? '/shared/utils' : path.resolve(__dirname, '../../shared/utils'),
|
|
'@avanzacast/shared-types': process.env.DOCKER_ENV ? '/shared/types' : path.resolve(__dirname, '../../shared/types'),
|
|
'@avanzacast/shared-config': process.env.DOCKER_ENV ? '/shared/config' : path.resolve(__dirname, '../../shared/config')
|
|
,
|
|
// Ensure react-icons subpackages imported from /shared resolve to the
|
|
// node_modules installed in the image.
|
|
'react-icons': process.env.DOCKER_ENV ? '/app/node_modules/react-icons' : 'react-icons',
|
|
'react-icons/si': process.env.DOCKER_ENV ? '/app/node_modules/react-icons/si' : 'react-icons/si',
|
|
'react-icons/md': process.env.DOCKER_ENV ? '/app/node_modules/react-icons/md' : 'react-icons/md',
|
|
'react-icons/fa': process.env.DOCKER_ENV ? '/app/node_modules/react-icons/fa' : 'react-icons/fa',
|
|
'react-icons/fa6': process.env.DOCKER_ENV ? '/app/node_modules/react-icons/fa6' : 'react-icons/fa6',
|
|
'react-icons/bs': process.env.DOCKER_ENV ? '/app/node_modules/react-icons/bs' : 'react-icons/bs'
|
|
}
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
host: true,
|
|
fs: {
|
|
// Allow serving files from the shared folder when mounted in Docker
|
|
allow: [
|
|
path.resolve(__dirname),
|
|
process.env.DOCKER_ENV ? '/shared' : path.resolve(__dirname, '../../shared')
|
|
]
|
|
,
|
|
// Disable strict fs checking so imports from outside project root work
|
|
strict: false
|
|
},
|
|
watch: {
|
|
usePolling: true
|
|
}
|
|
}
|
|
})
|