52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
import { defineConfig } from 'astro/config';
|
|
import react from "@astrojs/react";
|
|
import tailwind from "@astrojs/tailwind";
|
|
import { chunkSplitPlugin } from 'vite-plugin-chunk-split';
|
|
|
|
// https://astro.build/config
|
|
export default defineConfig({
|
|
output: 'static',
|
|
// Use client:only for all React components
|
|
integrations: [
|
|
react({ ssr: false }), // Disable SSR for React components
|
|
tailwind()
|
|
],
|
|
vite: {
|
|
preview: {
|
|
allowedHosts: ['chat-with-ai.s38.siliconpin.com'],
|
|
},
|
|
server: {
|
|
host: true, // Allow all hosts
|
|
// OR specify the exact host:
|
|
// host: 'chat-with-ai.s38.siliconpin.com',
|
|
},
|
|
plugins: [
|
|
chunkSplitPlugin({
|
|
strategy: 'default',
|
|
customSplitting: {
|
|
'ui-components': [/src\/components\/ui\/.*/],
|
|
'contexts': [/src\/contexts\/.*/],
|
|
'utils': [/src\/utils\/.*/],
|
|
'document-extraction': [/src\/utils\/documentExtraction.ts/],
|
|
'mongo-sync': [/src\/utils\/mongoSync.ts/],
|
|
'react-vendor': ['react', 'react-dom']
|
|
}
|
|
})
|
|
],
|
|
// Avoid hydration issues with different Node.js environments
|
|
ssr: {
|
|
noExternal: ['@radix-ui/*', 'class-variance-authority']
|
|
},
|
|
build: {
|
|
chunkSizeWarningLimit: 1000,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
'pdf-lib': ['pdfjs-dist']
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|