Persist workspace tabs in the app shell with Ant Design styling aligned to the desktop top bar, and fix tab bar layout flicker on select. Add shared PageHeader components, query helpers, and missing header state across CRM views; improve mobile shell layout and Vite HMR stability on Windows. Co-authored-by: Cursor <cursoragent@cursor.com>
53 lines
1.7 KiB
TypeScript
53 lines
1.7 KiB
TypeScript
import { defineConfig, loadEnv } from 'vite';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import { fileURLToPath, URL } from 'node:url';
|
|
|
|
const PROD_API = 'https://crm.montzar.ir';
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), '');
|
|
const apiTarget = env.MENTO_DEV_API || process.env.MENTO_DEV_API || PROD_API;
|
|
const usingLocalApi = apiTarget.includes('127.0.0.1') || apiTarget.includes('localhost');
|
|
|
|
// eslint-disable-next-line no-console
|
|
console.log(`[montact] UI → ${apiTarget}${usingLocalApi ? ' (API لوکال)' : ' (سرور اصلی)'}`);
|
|
|
|
return {
|
|
plugins: [
|
|
vue(),
|
|
tailwindcss(),
|
|
{
|
|
name: 'survive-windows-watcher',
|
|
configureServer(server) {
|
|
// On Windows, fs.watch throws EBUSY when a file is locked (brand SVGs,
|
|
// antivirus). An unhandled watcher "error" kills Vite and the page
|
|
// stays white because nothing is left to serve a refresh.
|
|
server.watcher.on('error', (err: NodeJS.ErrnoException) => {
|
|
console.error(
|
|
`[vite] watcher ${err?.code || 'error'} ignored: ${err?.message || err}`,
|
|
);
|
|
});
|
|
},
|
|
},
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
'@mento/shared': fileURLToPath(new URL('../../packages/shared/src/index.ts', import.meta.url)),
|
|
},
|
|
},
|
|
server: {
|
|
host: '127.0.0.1',
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: apiTarget,
|
|
changeOrigin: true,
|
|
secure: apiTarget.startsWith('https://'),
|
|
},
|
|
},
|
|
},
|
|
};
|
|
});
|