import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import { fileURLToPath } from 'node:url' import { falconUiAlias, falconUiAllowRoot, falconUiPlugin } from './src/falcon-ui.link.mjs' // The falcon-neo package is not on npm yet. Until it ships, two GENERATED // files stand in, and falcon init/dev keeps both refreshed: // - src/falcon-sdk-shim.js: the real built Falcon SDK ('falcon-neo/sdk'). // - src/falcon-ui.link.mjs: wires the Falcon design system ('falcon-neo/ui') // straight into the Falcon checkout (aliases + the StyleX compile plugin // + the vite fs allowance it needs). // When falcon-neo is published: add it to dependencies, delete the alias // block and the generated files. Every import line in your code stays // exactly the same. export default defineConfig(async () => ({ plugins: [react(), await falconUiPlugin()], resolve: { // One React only: falcon-ui components resolve react from this app. dedupe: ['react', 'react-dom'], alias: { ...falconUiAlias, 'falcon-neo/sdk': fileURLToPath(new URL('./src/falcon-sdk-shim.js', import.meta.url)) } }, server: { fs: { allow: ['.', falconUiAllowRoot] } } }))