Files
Buğra Canata cebcfd4e78 Fix Netlify build: disable image compression
Disabling Image compression in astro-compress to fix build error:
"pngload: libspng read error"

The error was caused by a corrupted PNG file that Sharp couldn't process.
Images will still be served normally, just not recompressed during build.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-17 20:11:47 +03:00

93 lines
2.2 KiB
TypeScript

import path from 'path';
import { fileURLToPath } from 'url';
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';
import mdx from '@astrojs/mdx';
import partytown from '@astrojs/partytown';
import icon from 'astro-icon';
import compress from 'astro-compress';
import type { AstroIntegration } from 'astro';
import astrowind from './vendor/integration';
import { readingTimeRemarkPlugin, responsiveTablesRehypePlugin, lazyImagesRehypePlugin } from './src/utils/frontmatter';
import react from '@astrojs/react';
import markdoc from '@astrojs/markdoc';
import keystatic from '@keystatic/astro';
import netlify from '@astrojs/netlify';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const hasExternalScripts = true;
const whenExternalScripts = (items: (() => AstroIntegration) | (() => AstroIntegration)[] = []) =>
hasExternalScripts ? (Array.isArray(items) ? items.map((item) => item()) : [items()]) : [];
export default defineConfig({
output: 'server',
integrations: [tailwind({
applyBaseStyles: false,
}), sitemap(), mdx(), icon({
include: {
tabler: ['*'],
'flat-color-icons': [
'template',
'gallery',
'approval',
'document',
'advertising',
'currency-exchange',
'voice-presentation',
'business-contact',
'database',
],
},
}), ...whenExternalScripts(() =>
partytown({
config: { forward: ['dataLayer.push'] },
})
), compress({
CSS: true,
HTML: {
'html-minifier-terser': {
removeAttributeQuotes: false,
},
},
Image: false,
JavaScript: true,
SVG: true,
Logger: 1,
}), astrowind({
config: './src/config.yaml',
}), react(), markdoc(), keystatic()],
i18n: {
defaultLocale: 'tr',
locales: ['tr', 'en'],
},
image: {
domains: ['cdn.pixabay.com'],
},
markdown: {
remarkPlugins: [readingTimeRemarkPlugin],
rehypePlugins: [responsiveTablesRehypePlugin, lazyImagesRehypePlugin],
},
vite: {
resolve: {
alias: {
'~': path.resolve(__dirname, './src'),
},
},
},
adapter: netlify(),
});