/// import { defineConfig } from 'vite'; import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'; import { resolve } from 'path'; export default defineConfig(() => ({ root: __dirname, cacheDir: '../../node_modules/.vite/demos', server: { port: 8080, host: 'localhost', // Serve static files from the demos directory fs: { allow: ['../..'] }, // Serve build artifacts for local testing cors: true, }, // Serve build artifacts as static files publicDir: false, preview: { port: 8080, host: 'localhost', }, plugins: [ nxViteTsPaths(), nxCopyAssetsPlugin(['*.md', '*.mp4', '*.env*']) ], // Single entry point for now - just the main BuzzTrail demo build: { outDir: '../../dist/demos', emptyOutDir: true, reportCompressedSize: true, rollupOptions: { input: { main: resolve(__dirname, 'buzztrail-video-demo/index.html'), } }, commonjsOptions: { transformMixedEsModules: true, }, }, // Environment variable support envDir: __dirname, envPrefix: ['VITE_'], }));