- move reusable domain, data, state, ui code into src/lib - update host screens to consume new library exports - document architecture and configure path aliases - bump astro integration dependencies for compatibility Refs #30
51 lines
1.0 KiB
JavaScript
51 lines
1.0 KiB
JavaScript
// @ts-check
|
|
import { fileURLToPath } from 'node:url';
|
|
import { defineConfig } from 'astro/config';
|
|
|
|
const srcDir = fileURLToPath(new URL('./src', import.meta.url));
|
|
const libDir = fileURLToPath(new URL('./src/lib', import.meta.url));
|
|
import preact from '@astrojs/preact';
|
|
|
|
// https://astro.build/config
|
|
export default defineConfig({
|
|
integrations: [
|
|
preact({
|
|
compat: true, // Enable React compatibility for better ecosystem support
|
|
})
|
|
],
|
|
|
|
// Build optimizations
|
|
build: {
|
|
inlineStylesheets: 'auto',
|
|
},
|
|
|
|
// Vite configuration for development
|
|
vite: {
|
|
resolve: {
|
|
alias: {
|
|
'@': srcDir,
|
|
'@lib': libDir,
|
|
},
|
|
},
|
|
define: {
|
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
|
},
|
|
css: {
|
|
modules: {
|
|
localsConvention: 'camelCase',
|
|
},
|
|
},
|
|
optimizeDeps: {
|
|
include: ['preact/hooks'],
|
|
},
|
|
},
|
|
|
|
// Development server configuration
|
|
server: {
|
|
port: 3000,
|
|
host: true,
|
|
},
|
|
|
|
// Performance and SEO optimizations
|
|
compressHTML: true,
|
|
}); |