2025-03-17 09:39:04 +07:00
|
|
|
/// <reference types='vitest' />
|
|
|
|
|
import { defineConfig } from 'vite';
|
|
|
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
|
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
|
|
|
import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin';
|
2026-04-11 17:04:14 +07:00
|
|
|
import { TanStackRouterVite } from '@tanstack/router-plugin/vite';
|
2025-03-17 09:39:04 +07:00
|
|
|
|
|
|
|
|
export default defineConfig(() => ({
|
|
|
|
|
root: __dirname,
|
|
|
|
|
cacheDir: '../../node_modules/.vite/apps/backoffice',
|
|
|
|
|
server: {
|
2025-12-10 08:41:30 +07:00
|
|
|
port: 3003,
|
2025-03-17 09:39:04 +07:00
|
|
|
host: 'localhost',
|
|
|
|
|
},
|
|
|
|
|
preview: {
|
2025-04-03 06:10:07 +07:00
|
|
|
port: 3001,
|
2025-03-17 09:39:04 +07:00
|
|
|
host: 'localhost',
|
|
|
|
|
},
|
2026-04-12 23:57:57 +07:00
|
|
|
resolve: {
|
|
|
|
|
dedupe: ['react', 'react-dom', '@tanstack/react-router', '@tanstack/react-query'],
|
|
|
|
|
},
|
2026-04-11 17:04:14 +07:00
|
|
|
plugins: [
|
|
|
|
|
TanStackRouterVite({
|
|
|
|
|
routeFileIgnorePattern: '_components|_hooks|_hook|_data',
|
|
|
|
|
}),
|
|
|
|
|
react(),
|
|
|
|
|
nxViteTsPaths(),
|
|
|
|
|
nxCopyAssetsPlugin(['*.md']),
|
|
|
|
|
],
|
2025-03-17 09:39:04 +07:00
|
|
|
build: {
|
|
|
|
|
outDir: '../../dist/apps/backoffice',
|
|
|
|
|
emptyOutDir: true,
|
|
|
|
|
reportCompressedSize: true,
|
|
|
|
|
commonjsOptions: {
|
|
|
|
|
transformMixedEsModules: true,
|
|
|
|
|
},
|
2026-04-12 23:57:57 +07:00
|
|
|
rolldownOptions: {
|
|
|
|
|
output: { codeSplitting: { groups: [{ name: 'vendor', test: /node_modules/ }] } },
|
|
|
|
|
},
|
2025-03-17 09:39:04 +07:00
|
|
|
},
|
|
|
|
|
test: {
|
|
|
|
|
watch: false,
|
|
|
|
|
globals: true,
|
|
|
|
|
environment: 'jsdom',
|
|
|
|
|
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
|
|
|
reporters: ['default'],
|
|
|
|
|
coverage: {
|
|
|
|
|
reportsDirectory: '../../coverage/apps/backoffice',
|
|
|
|
|
provider: 'v8' as const,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}));
|