1
1
import path from 'path' ;
2
2
import { fileURLToPath } from 'url' ;
3
-
4
3
import { defineConfig , squooshImageService } from 'astro/config' ;
5
-
6
4
import sitemap from '@astrojs/sitemap' ;
7
5
import tailwind from '@astrojs/tailwind' ;
8
6
import mdx from '@astrojs/mdx' ;
9
7
import partytown from '@astrojs/partytown' ;
10
8
import icon from 'astro-icon' ;
11
9
import compress from 'astro-compress' ;
12
10
import tasks from './src/utils/tasks' ;
13
-
14
11
import { readingTimeRemarkPlugin , responsiveTablesRehypePlugin } from './src/utils/frontmatter.mjs' ;
15
-
16
12
import { ANALYTICS , SITE } from './src/utils/config.ts' ;
17
-
13
+ import react from "@astrojs/react" ;
14
+ import markdoc from "@astrojs/markdoc" ;
15
+ import keystatic from '@keystatic/astro' ;
18
16
const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
17
+ const whenExternalScripts = ( items = [ ] ) => ANALYTICS . vendors . googleAnalytics . id && ANALYTICS . vendors . googleAnalytics . partytown ? Array . isArray ( items ) ? items . map ( item => item ( ) ) : [ items ( ) ] : [ ] ;
19
18
20
- const whenExternalScripts = ( items = [ ] ) =>
21
- ANALYTICS . vendors . googleAnalytics . id && ANALYTICS . vendors . googleAnalytics . partytown
22
- ? Array . isArray ( items )
23
- ? items . map ( ( item ) => item ( ) )
24
- : [ items ( ) ]
25
- : [ ] ;
26
-
19
+ // https://astro.build/config
27
20
export default defineConfig ( {
28
21
site : SITE . site ,
29
22
base : SITE . base ,
30
23
trailingSlash : SITE . trailingSlash ? 'always' : 'never' ,
31
-
32
24
output : 'hybrid' ,
33
-
34
- integrations : [
35
- tailwind ( {
36
- applyBaseStyles : false ,
37
- } ) ,
38
- sitemap ( ) ,
39
- mdx ( ) ,
40
- icon ( {
41
- include : {
42
- tabler : [ '*' ] ,
43
- 'flat-color-icons' : [
44
- 'template' ,
45
- 'gallery' ,
46
- 'approval' ,
47
- 'document' ,
48
- 'advertising' ,
49
- 'currency-exchange' ,
50
- 'voice-presentation' ,
51
- 'business-contact' ,
52
- 'database' ,
53
- ] ,
54
- } ,
55
- } ) ,
56
-
57
- ...whenExternalScripts ( ( ) =>
58
- partytown ( {
59
- config : { forward : [ 'dataLayer.push' ] } ,
60
- } )
61
- ) ,
62
-
63
- compress ( {
64
- CSS : true ,
65
- HTML : {
66
- 'html-minifier-terser' : {
67
- removeAttributeQuotes : false ,
68
- } ,
69
- } ,
70
- Image : false ,
71
- JavaScript : true ,
72
- SVG : false ,
73
- Logger : 1 ,
74
- } ) ,
75
-
76
- tasks ( ) ,
77
- ] ,
78
-
25
+ integrations : [ tailwind ( {
26
+ applyBaseStyles : false
27
+ } ) , sitemap ( ) , mdx ( ) , icon ( {
28
+ include : {
29
+ tabler : [ '*' ] ,
30
+ 'flat-color-icons' : [ 'template' , 'gallery' , 'approval' , 'document' , 'advertising' , 'currency-exchange' , 'voice-presentation' , 'business-contact' , 'database' ]
31
+ }
32
+ } ) , ...whenExternalScripts ( ( ) => partytown ( {
33
+ config : {
34
+ forward : [ 'dataLayer.push' ]
35
+ }
36
+ } ) ) , compress ( {
37
+ CSS : true ,
38
+ HTML : {
39
+ 'html-minifier-terser' : {
40
+ removeAttributeQuotes : false
41
+ }
42
+ } ,
43
+ Image : false ,
44
+ JavaScript : true ,
45
+ SVG : false ,
46
+ Logger : 1
47
+ } ) , tasks ( ) , react ( ) , markdoc ( ) , keystatic ( ) ] ,
79
48
image : {
80
- service : squooshImageService ( ) ,
49
+ service : squooshImageService ( )
81
50
} ,
82
-
83
51
markdown : {
84
52
remarkPlugins : [ readingTimeRemarkPlugin ] ,
85
- rehypePlugins : [ responsiveTablesRehypePlugin ] ,
53
+ rehypePlugins : [ responsiveTablesRehypePlugin ]
86
54
} ,
87
-
88
55
vite : {
89
56
resolve : {
90
57
alias : {
91
- '~' : path . resolve ( __dirname , './src' ) ,
92
- } ,
93
- } ,
94
- } ,
95
- } ) ;
58
+ '~' : path . resolve ( __dirname , './src' )
59
+ }
60
+ }
61
+ }
62
+ } ) ;
0 commit comments