Files
365devnet/astro.config.ts
becarta 1d7883a9c7
Some checks failed
GitHub Actions / build (18) (push) Has been cancelled
GitHub Actions / build (20) (push) Has been cancelled
GitHub Actions / build (22) (push) Has been cancelled
GitHub Actions / check (push) Has been cancelled
Remove unused image service entrypoint from Astro configuration
2025-05-10 00:09:44 +02:00

165 lines
3.6 KiB
TypeScript

import path from 'path';
import { fileURLToPath } from 'url';
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';
import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';
import mdx from '@astrojs/mdx';
import react from '@astrojs/react';
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';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const hasExternalScripts = false;
const whenExternalScripts = (items: (() => AstroIntegration) | (() => AstroIntegration)[] = []) =>
hasExternalScripts ? (Array.isArray(items) ? items.map((item) => item()) : [items()]) : [];
export default defineConfig({
output: 'server',
adapter: node({
mode: 'standalone'
}),
site: 'https://www.365devnet.com',
i18n: {
locales: ["en", "de", "nl", "fr"],
defaultLocale: "en",
routing: {
strategy: 'prefix-always',
},
},
integrations: [
react({
include: ['**/react/*'],
exclude: ['**/react/*.test.{js,jsx,ts,tsx}'],
}),
tailwind({
applyBaseStyles: false,
config: {
future: {
hoverOnlyWhenSupported: true,
},
},
}),
sitemap({
changefreq: 'weekly',
priority: 0.7,
lastmod: new Date(),
}),
mdx({
drafts: false,
syntaxHighlight: 'prism',
rehypePlugins: [responsiveTablesRehypePlugin, lazyImagesRehypePlugin],
}),
icon({
include: {
tabler: ['*'],
'flat-color-icons': [
'template',
'gallery',
'approval',
'document',
'advertising',
'currency-exchange',
'voice-presentation',
'business-contact',
'database',
],
'circle-flags': ['*'],
},
}),
...whenExternalScripts(() =>
partytown({
config: { forward: ['dataLayer.push'] },
})
),
compress({
CSS: true,
HTML: {
'html-minifier-terser': {
removeAttributeQuotes: false,
collapseWhitespace: true,
removeComments: true,
minifyCSS: true,
minifyJS: true,
},
},
Image: {
sharp: {
quality: 80,
progressive: true,
},
},
JavaScript: {
compress: true,
mangle: true,
format: {
comments: false,
},
},
SVG: false,
Logger: 1,
}),
astrowind({
config: './src/config.yaml',
}),
],
image: {
domains: ['cdn.pixabay.com', 'raw.githubusercontent.com'],
remotePatterns: [
{
protocol: 'https',
hostname: 'cdn.pixabay.com',
},
{
protocol: 'https',
hostname: 'raw.githubusercontent.com',
},
],
},
markdown: {
remarkPlugins: [readingTimeRemarkPlugin],
rehypePlugins: [responsiveTablesRehypePlugin, lazyImagesRehypePlugin],
syntaxHighlight: 'prism',
},
vite: {
resolve: {
alias: {
'~': path.resolve(__dirname, './src'),
},
},
build: {
target: 'esnext',
minify: 'terser',
cssMinify: true,
rollupOptions: {
output: {
manualChunks: {
'react-vendor': ['react', 'react-dom'],
'ui-vendor': ['@astrojs/react', '@astrojs/tailwind'],
},
},
},
},
optimizeDeps: {
include: ['react', 'react-dom'],
},
},
});