Files
bface/vite.config.js
Amer Agovic 859db6ccb2 Release 1.0.8 with platform, security, and UI hardening.
Adds API filter registry, style theme registry, SW bitmask cache clear, KV namespacing, session expiry checks, accessibility improvements, and expanded test coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 21:08:21 -05:00

57 lines
1.7 KiB
JavaScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/** Keep peer/runtime deps out of published dist (including subpaths like @tamagui/config/v3). */
function isExternal(id) {
if (id === 'react' || id === 'react/jsx-runtime' || id === 'react-dom' || id === 'react-dom/client') {
return true;
}
if (id === '@phosphor-icons/react' || id.startsWith('@phosphor-icons/react/')) return true;
if (id === 'tamagui' || id.startsWith('tamagui/')) return true;
if (id.startsWith('@tamagui/')) return true;
return false;
}
export default defineConfig({
plugins: [
react(),
dts({
tsconfigPath: './tsconfig.json',
insertTypesEntry: true,
include: ['src/**/*.js', 'src/**/*.jsx'],
exclude: ['**/*.test.*', '**/test/**']
})
],
build: {
lib: {
entry: {
index: path.resolve(__dirname, 'src/index.js'),
'ui/components/index': path.resolve(__dirname, 'src/ui/components/index.js'),
'ui/route-loading': path.resolve(__dirname, 'src/ui/route-loading.js'),
'ui/pages/SettingsPage': path.resolve(__dirname, 'src/ui/pages/SettingsPage.jsx')
},
formats: ['es']
},
rollupOptions: {
external: isExternal,
output: {
// Preserve module structure - automatically preserves directory structure
preserveModules: true,
preserveModulesRoot: 'src',
// Use original file names and paths
entryFileNames: '[name].js',
chunkFileNames: '[name].js'
}
},
outDir: 'dist',
emptyOutDir: true,
sourcemap: true
}
});