-
Notifications
You must be signed in to change notification settings - Fork 8
/
astro.config.ts
91 lines (83 loc) · 2.51 KB
/
astro.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import { SITE_URL } from './src/consts';
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import tailwind from '@astrojs/tailwind';
import vue from '@astrojs/vue';
import AutoImport from 'astro-auto-import';
import cssnano from 'cssnano';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import remarkSmartypants from 'remark-smartypants';
import { asideAutoImport, astroAsides } from './integrations/astro-asides';
import { astroDocsExpressiveCode } from './integrations/expressive-code';
import { sitemap } from './integrations/sitemap';
import { autoLinks } from './plugins/rehype-autolink-config';
import rehypeSlug from './plugins/rehype-slug-config'
import { rehypei18nAutolinkHeadings } from './plugins/rehype-i18n-autolink-headings';
import { rehypeOptimizeStatic } from './plugins/rehype-optimize-static';
import { rehypeTasklistEnhancer } from './plugins/rehype-tasklist-enhancer';
import rehypeScrollableTables from './plugins/rehype-scrollable-tables.js'
const productionBuild = import.meta.env.PROD;
export default defineConfig({
site: SITE_URL,
build: {
inlineStylesheets: 'always',
assets: '_astro_docs'
},
integrations: [
AutoImport({ imports: [asideAutoImport] }),
sitemap(),
astroAsides(),
astroDocsExpressiveCode(),
mdx(),
tailwind({ applyBaseStyles: false }),
vue({ appEntrypoint: '/src/vue.config.js' })
],
markdown: {
// Override with our own config
smartypants: false,
remarkPlugins: [
[remarkSmartypants, { dashes: false }],
// Add our custom plugin that marks links to fallback language pages
],
rehypePlugins: [
rehypeSlug,
rehypeScrollableTables,
// This adds links to headings
// rehypeLinks, // disabling target Blank
[rehypeAutolinkHeadings, autoLinks],
// Tweak GFM task list syntax
rehypeTasklistEnhancer(),
// Translates the autolink headings anchors
rehypei18nAutolinkHeadings(),
// Collapse static parts of the hast to html
rehypeOptimizeStatic,
]
},
compressHTML: productionBuild ? true : false,
trailingSlash: 'always', // for server
vite: {
ssrBuild: true,
server: {
fs: {
allow: ['..']
}
},
plugins: [
cssnano({
preset: [
'default', {
discardComments: { removeAll: true },
minifyFontValues: { removeQuotes: false }
}
]
})
],
ssr: {
noExternal: ['@astrojs/vue', 'azion-webkit', 'azion-theme'],
external: ['vue']
},
optimizeDeps: {
include: ['vue', 'primevue/config']
}
}
});