Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 43 additions & 6 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { SITE_URL } from './src/consts';
import { defineConfig } from 'astro/config';
import { unified } from '@astrojs/markdown-remark';
import tailwindcss from '@tailwindcss/vite';

import mdx from '@astrojs/mdx';
import tailwind from '@astrojs/tailwind';
import vue from '@astrojs/vue';
import preact from '@astrojs/preact';
import AutoImport from 'astro-auto-import';
Expand Down Expand Up @@ -40,16 +41,21 @@ export default defineConfig({
astroAsides(),
AzionExpressiveCode(),
mdx(),
tailwind({ applyBaseStyles: false }),
vue({ appEntrypoint: '/src/vue.config.js' })
],
markdown: {
// Astro 7 defaults to the Sätteri (Rust) markdown pipeline, which does not
// run remark/rehype plugins. Keep the unified() processor until the custom
// plugins below are ported to Sätteri (planned as a follow-up).
processor: unified() as any,
// Override with our own config
smartypants: false,
// The plugins below were written against unified 10 typings; they run
// fine on the unified() processor but Astro 7's plugin types reject them.
remarkPlugins: [
[remarkSmartypants, { dashes: false }],
// Add our custom plugin that marks links to fallback language pages
],
] as any,
rehypePlugins: [
rehypeSlug,
rehypeScrollableTables,
Expand All @@ -62,18 +68,47 @@ export default defineConfig({
rehypei18nAutolinkHeadings(),
// Collapse static parts of the hast to html
rehypeOptimizeStatic,
]
] as any
},
compressHTML: productionBuild ? true : false,
trailingSlash: 'always', // for server
vite: {
ssrBuild: true,
server: {
fs: {
allow: ['..']
}
},
plugins: [
tailwindcss(),
{
// Astro 7 renders static pages in a dedicated `prerender` Vite
// environment that does not inherit the legacy `ssr.noExternal`
// list (and Astro overwrites `environments.prerender` wholesale in
// its build config). These packages must be bundled — primevue's
// ESM files use directory imports (e.g. `primevue/api`) that Node
// cannot resolve when the package is externalized.
name: 'azion:server-noexternal',
configEnvironment(name: string) {
if (name === 'client') return null;
return {
resolve: {
noExternal: ['@astrojs/vue', 'azion-webkit', 'azion-theme', 'primevue'],
external: ['vue']
}
};
},
// Astro's crawlFrameworkPkgs marks primevue as external for the
// server/prerender builds, and `external` wins over `noExternal`.
// Strip it from the final resolved config so it really gets bundled.
configResolved(config: any) {
for (const c of Object.values(config.environments ?? {}) as any[]) {
const ext = c?.resolve?.external;
if (Array.isArray(ext) && ext.includes('primevue')) {
c.resolve.external = ext.filter((name: string) => name !== 'primevue');
}
}
}
},
cssnano({
preset: [
'default', {
Expand All @@ -84,7 +119,9 @@ export default defineConfig({
})
],
ssr: {
noExternal: ['@astrojs/vue', 'azion-webkit', 'azion-theme'],
// primevue must be bundled: its ESM files use directory imports
// (e.g. `primevue/api`), which Node cannot resolve when externalized.
noExternal: ['@astrojs/vue', 'azion-webkit', 'azion-theme', 'primevue'],
external: ['vue']
},
optimizeDeps: {
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@
"devDependencies": {
"@11ty/eleventy-fetch": "^3.0.0",
"@actions/core": "^1.9.0",
"@astrojs/check": "^0.9.4",
"@astrojs/mdx": "^4.0.8",
"@astrojs/sitemap": "1.0.1",
"@astrojs/check": "^0.9.10",
"@astrojs/markdown-remark": "^7.2.2",
"@astrojs/mdx": "^7.0.5",
"@astrojs/sitemap": "3.7.3",
"@babel/core": "^7.29.6",
"@tailwindcss/typography": "^0.5.10",
"@types/canvas-confetti": "^1.6.0",
Expand All @@ -53,12 +54,11 @@
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"algoliasearch": "^4.22.1",
"astro": "^5.2.5",
"astro-auto-import": "^0.4.2",
"astro": "^7.2.3",
"astro-auto-import": "^0.5.2",
"astro-eslint-parser": "^0.9.2",
"astro-expressive-code": "^0.40.1",
"astro-og-canvas": "^0.5.6",
"autoprefixer": "^10.4.17",
"astro-expressive-code": "^0.44.1",
"astro-og-canvas": "^0.13.0",
"bcp-47-normalize": "^2.1.0",
"chroma-js": "^2.4.2",
"cssnano": "^6.0.3",
Expand Down Expand Up @@ -102,16 +102,16 @@
"unist-util-visit": "^4.1.0",
"unist-util-walker": "^1.0.0",
"vfile": "^5.3.6",
"vite": "^6.4.3",
"vite": "^8.2.1",
"vite-plugin-dynamic-import": "^1.5.0"
},
"dependencies": {
"@astrojs/preact": "^4.1.2",
"@astrojs/tailwind": "^6.0.0",
"@astrojs/vue": "^5.0.6",
"@astrojs/preact": "^6.0.2",
"@astrojs/vue": "^7.0.2",
"@aziontech/icons": "^1.0.4",
"@babel/types": "^7.22.19",
"@nanostores/preact": "^0.5.2",
"@tailwindcss/vite": "^4.3.3",
"azion-theme": "^1.15.3",
"azion-webkit": "^1.271.5",
"canvas-confetti": "^1.6.0",
Expand All @@ -128,9 +128,9 @@
"remark-smartypants": "^2.0.0",
"sass": "1.102.0",
"sharp": "^0.35.0",
"tailwindcss": "^3.4.1",
"tailwindcss": "^4.3.3",
"terser": "^5.36.0",
"vue": "^3.4.24",
"vue": "^3.5.25",
"vue-instantsearch": "^4.13.5"
},
"engines": {
Expand Down
Loading
Loading