-
Notifications
You must be signed in to change notification settings - Fork 8
/
astro.config.ts
94 lines (86 loc) · 2.6 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
92
93
94
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 preact from '@astrojs/preact';
import AutoImport from 'astro-auto-import';
import cssnano from 'cssnano';
import dynamicImport from 'vite-plugin-dynamic-import';
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'
// import { rehypeLinks } from './plugins/rehypeLinks.mjs';
const productionBuild = import.meta.env.PROD;
export default defineConfig({
site: SITE_URL,
build: {
inlineStylesheets: 'always',
assets: '_astro_docs'
},
integrations: [
AutoImport({ imports: [asideAutoImport] }),
preact({ compat: true }),
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: [
dynamicImport(),
cssnano
],
ssr: {
noExternal: [
'@astrojs/vue',
'azion-webkit',
'azion-theme'
],
external: [
'algoliasearch',
'instantsearch.js',
'vue-instantsearch/vue3/es',
]
}
}
});