feat: configure vite settings for portal and backoffice apps with shared environment directory

This commit is contained in:
Estifo77
2026-08-18 13:47:45 +03:00
parent cb19928bde
commit 007c0e3d71
2 changed files with 27 additions and 18 deletions

View File

@@ -9,19 +9,19 @@ export default defineConfig({
// its built-in default.
envDir: '../../',
cacheDir: '../../node_modules/.vite/apps/backoffice',
// server: {
// port: 4201,
// host: 'localhost',
// },
server: {
port: 4201,
proxy: {
'/api': {
target: 'http://localhost:3000', // change from 'https://ema-api-dev.triaplc.com'
changeOrigin: true,
},
port: 4201,
host: 'localhost',
},
},
// server: {
// port: 4201,
// proxy: {
// '/api': {
// target: 'http://localhost:3000', // change from 'https://ema-api-dev.triaplc.com'
// changeOrigin: true,
// },
// },
// },
preview: { port: 4201, host: 'localhost' },
plugins: [react(), nxViteTsPaths()],
resolve: {
@@ -45,11 +45,11 @@ export default defineConfig({
// Unit tests for the pure helpers behind a screen (formatters, URL state).
// Component tests are deliberately not set up: nothing here renders React,
// so no jsdom environment or setup file is needed.
test: {
watch: false,
globals: true,
environment: 'node',
include: ['src/**/*.spec.ts'],
reporters: ['default'],
},
// test: {
// watch: false,
// globals: true,
// environment: 'node',
// include: ['src/**/*.spec.ts'],
// reporters: ['default'],
// },
});

View File

@@ -10,6 +10,15 @@ export default defineConfig({
envDir: '../../',
cacheDir: '../../node_modules/.vite/apps/portal',
server: { port: 4200, host: 'localhost' },
// server: {
// port: 4200,
// proxy: {
// '/api': {
// target: 'http://localhost:3000', // change from 'https://ema-api-dev.triaplc.com'
// changeOrigin: true,
// },
// },
// },
preview: { port: 4200, host: 'localhost' },
plugins: [react(), nxViteTsPaths()],
resolve: {