157 lines
3.5 KiB
TypeScript
157 lines
3.5 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: {
|
|
service: {
|
|
entrypoint: 'astro/assets/services/sharp',
|
|
},
|
|
},
|
|
|
|
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'],
|
|
},
|
|
},
|
|
});
|
|
|