import { defineConfig } from 'astro/config' import tailwindcss from '@tailwindcss/vite' import { imagetools } from "imagetools" import domainExpansion from '@domain-expansion/astro'; import react from "@astrojs/react" import mdx from "@astrojs/mdx"; import { defineConfig } from 'astro/config'; import compress from 'vite-plugin-compression'; import sitemap from "@astrojs/sitemap"; import toc from '@jsdevtools/rehype-toc' import { rehypeAccessibleEmojis } from 'rehype-accessible-emojis'; import getReadingTime from 'reading-time'; import { toString } from 'mdast-util-to-string'; export function remarkReadingTime() { return function (tree, { data }) { const textOnPage = toString(tree); const readingTime = getReadingTime(textOnPage); data.astro.frontmatter.minutesRead = readingTime.text; }; } /** * @link : https://github.com/rehypejs/rehype/blob/main/doc/plugins.md * @link : https://tanggd.github.io/en/guides/markdown-content/#configuring-markdown-and-mdx */ export default defineConfig({ site: 'https://creava.org', devToolbar: { enabled: false, }, i18n: { locales: ['en','es','fr','it','de'], defaultLocale: "en", }, alias: { "@base": "../polymech-site/src" }, vite: { resolve: { alias: { '@components': '/src/components', '@layouts': '/src/layouts' } }, plugins: [ tailwindcss({ config: './tailwind.config.cjs', jit: true }), ], build: { target: 'esnext', assetsDir: './assets', modulePreload: { polyfill: false }, commonjsOptions: { esmExternals: true }, assetsInlineLimit: 1024, sourcemap: false, }, ssr: { external: ['cacache', 'glob', 'xlsx', 'sharp', '@polymech/kbot-d'] } }, markdown: { drafts: true, shikiConfig: { theme: "github-light-default" } }, shikiConfig: { wrap: true, skipInline: false, drafts: true }, integrations: [ //starlight(), sitemap({}), mdx({ rehypePlugins: [ rehypeAccessibleEmojis, remarkReadingTime ], }), //AstroPWA({}), react(), imagetools, domainExpansion({ }) /* webmanifest({ name: 'PolyMech', icon: 'public/logos/transparent.svg', short_name: 'App', description: 'Here she comes again :)', start_url: '/', theme_color: '#3367D6', background_color: '#3367D6', display: 'standalone', }) */ ] });