Files
TriggerFrontend/vite.config.ts
Sean Edmunds 6dc7654b76
All checks were successful
Deploy to production / build (push) Successful in 11s
Changing baseURL settings
Co-authored-by: Copilot <copilot@github.com>
2026-07-09 14:57:28 -05:00

89 lines
2.0 KiB
TypeScript

import path from 'node:path';
import react from '@vitejs/plugin-react';
import { defineConfig, loadEnv } from 'vite';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());
return {
build: {
assetsDir: 'triggerAssets',
rolldownOptions: {
output: {
codeSplitting: {
maxSize: 5000000,
groups: [
{
name: 'reactIcons',
test: /[\\/]react-icons\/(fi|fa|wi)[\\/]/,
},
{
name: 'reactIconsSi',
test: /[\\/]react-icons\/(si)[\\/]/,
},
{
name: 'reactIconsFa6',
test: /[\\/]react-icons\/(fa6)[\\/]/,
},
{
name: 'reactIconsVsc',
test: /[\\/]react-icons\/(vsc)[\\/]/,
},
{
name: (moduleId) => moduleId.includes('mantine') ? 'mantine' : null,
},
{
name: (moduleId) => moduleId.includes('tanstack') ? 'tanstack' : null,
},
{
name: 'recharts',
test: /[\\/]recharts[\\/]/
},
{
name: (moduleId) => moduleId.includes('utils') || moduleId.includes('dnd') ? 'utils' : null,
},
{
name: 'main',
test: /[\\/]src[\\/]/,
},
]
},
},
},
},
plugins: [react()],
base: `/${env.VITE_BASE_URL}`,
server: {
port: 3000,
host: '0.0.0.0',
proxy: {
'/api': {
target: `${env.VITE_DOMAIN_DEV}/${env.VITE_BASE_URL}`,
changeOrigin: false,
secure: false,
},
},
},
preview: {
port: 3000,
host: '0.0.0.0',
proxy: {
api: {
target: `${env.VITE_DOMAIN_DEV}`,
changeOrigin: false,
secure: false,
},
},
},
resolve: {
alias: {
components: path.resolve(__dirname, './src/components'),
hooks: path.resolve(__dirname, './src/hooks'),
pages: path.resolve(__dirname, './src/pages'),
styles: path.resolve(__dirname, './src/styles'),
types: path.resolve(__dirname, './src/types'),
contexts: path.resolve(__dirname, './src/contexts'),
},
},
};
});