2024-01-20 07:23:29 +00:00
|
|
|
import path from 'path';
|
|
|
|
import { fileURLToPath } from 'url';
|
|
|
|
|
|
|
|
import { defineConfig, squooshImageService } from 'astro/config';
|
|
|
|
|
|
|
|
import sitemap from '@astrojs/sitemap';
|
2023-10-18 12:14:50 +00:00
|
|
|
import tailwind from '@astrojs/tailwind';
|
2024-01-20 07:23:29 +00:00
|
|
|
import mdx from '@astrojs/mdx';
|
|
|
|
import partytown from '@astrojs/partytown';
|
|
|
|
import icon from 'astro-icon';
|
|
|
|
import tasks from './src/utils/tasks';
|
|
|
|
|
|
|
|
import { readingTimeRemarkPlugin, responsiveTablesRehypePlugin } from './src/utils/frontmatter.mjs';
|
|
|
|
|
|
|
|
import { ANALYTICS, SITE } from './src/utils/config.ts';
|
|
|
|
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
|
|
|
|
const whenExternalScripts = (items = []) =>
|
|
|
|
ANALYTICS.vendors.googleAnalytics.id && ANALYTICS.vendors.googleAnalytics.partytown
|
|
|
|
? Array.isArray(items)
|
|
|
|
? items.map((item) => item())
|
|
|
|
: [items()]
|
|
|
|
: [];
|
2023-10-18 12:14:50 +00:00
|
|
|
|
|
|
|
export default defineConfig({
|
2024-01-20 07:23:29 +00:00
|
|
|
site: SITE.site,
|
|
|
|
base: SITE.base,
|
|
|
|
trailingSlash: SITE.trailingSlash ? 'always' : 'never',
|
|
|
|
|
|
|
|
output: 'static',
|
|
|
|
|
|
|
|
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'] },
|
|
|
|
})
|
|
|
|
),
|
|
|
|
|
|
|
|
tasks(),
|
|
|
|
],
|
|
|
|
|
|
|
|
image: {
|
|
|
|
service: squooshImageService(),
|
|
|
|
},
|
|
|
|
|
|
|
|
markdown: {
|
|
|
|
remarkPlugins: [readingTimeRemarkPlugin],
|
|
|
|
rehypePlugins: [responsiveTablesRehypePlugin],
|
|
|
|
},
|
|
|
|
|
|
|
|
vite: {
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'~': path.resolve(__dirname, './src'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|