Files
flyer-crawler.projectium.com/vite.config.ts
Torben Sorensen 0e93e27a49
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 30s
move to using /src - still css issue work
2025-11-12 16:08:48 -08:00

54 lines
1.5 KiB
TypeScript

/// <reference types="vitest" />
import path from 'path';
import { defineConfig as defineViteConfig } from 'vite';
import { defineConfig as defineVitestConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import tailwindcssPostcss from '@tailwindcss/postcss';
import { sync } from 'glob'; // Import the glob sync function
// --- VITE CONFIG DEBUGGING ---
console.log('--- [VITE CONFIG DEBUG] ---');
const cwd = process.cwd();
console.log(`[VITE] Current Working Directory: ${cwd}`);
const contentPatterns = ['./index.html', './src/**/*.{js,ts,jsx,tsx}'];
try {
const foundFiles = sync(contentPatterns, { cwd, absolute: true });
console.log(`[VITE] Glob sync found ${foundFiles.length} files from CWD:`);
console.log(foundFiles.slice(0, 15)); // Log the first 15 found files
} catch (e) {
console.error('[VITE] Glob sync failed!', e);
}
console.log('--- [VITE CONFIG DEBUG END] ---');
// --- END VITE CONFIG DEBUGGING ---
const __dirname = path.dirname(new URL(import.meta.url).pathname);
const vitestConfig = defineVitestConfig({
test: {
environment: 'jsdom',
setupFiles: ['./src/vitest.setup.ts'],
},
});
const viteConfig = defineViteConfig({
plugins: [react()],
css: {
postcss: {
plugins: [
tailwindcssPostcss,
],
},
},
server: {
port: 3000,
host: '0.0.0.0',
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
}
},
});
export default { ...viteConfig, test: vitestConfig.test };