You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sims-hq/apps/pos/vite.config.ts

27 lines
1.1 KiB
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { fileURLToPath } from 'node:url'
const p = (rel: string) => fileURLToPath(new URL(rel, import.meta.url))
export default defineConfig({
base: './',
plugins: [react()],
resolve: {
alias: {
'@sims/domain': p('../../packages/domain/src/index.ts'),
'@sims/billing-engine': p('../../packages/billing-engine/src/index.ts'),
'@sims/config': p('../../packages/config/src/index.ts'),
// Browser-safe subpath (pure role→gate matrix) — must precede the barrel alias,
// whose index re-exports scrypt (node:crypto) and cannot enter the web bundle.
'@sims/auth/permissions': p('../../packages/auth/src/permissions.ts'),
'@sims/auth': p('../../packages/auth/src/index.ts'),
'@sims/scanning': p('../../packages/scanning/src/index.ts'),
'@sims/search-core': p('../../packages/search-core/src/index.ts'),
'@sims/printing': p('../../packages/printing/src/index.ts'),
'@sims/ui': p('../../packages/ui/src/index.ts'),
},
},
build: { outDir: 'dist' },
})