-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
76 lines (73 loc) · 1.79 KB
/
astro.config.mjs
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
import { defineConfig } from 'astro/config';
import alpine from '@astrojs/alpinejs';
import sitemap from '@astrojs/sitemap';
import compress from '@playform/compress';
import relativeLinks from 'astro-relative-links';
// import typograf from 'astro-typograf';
const terserOptions = {
compress: false,
mangle: false,
output: {
comments: false,
},
};
// https://astro.build/config
export default defineConfig({
site: 'https://yagee-astro-template.netlify.app/',
devToolbar: {
enabled: false,
},
build: {
// inlineStylesheets: 'never',
},
integrations: [
alpine({ entrypoint: '/src/entrypoint' }),
// typograf({
// selector: 'p, a, h1, h2, h3, div, span',
// }),
relativeLinks(),
compress({
CSS: {
csso: {
forceMediaMerge: true, // don't work because styles are inlined
},
},
HTML: {
'html-minifier-terser': {
collapseBooleanAttributes: true,
// collapseWhitespace: true,
// sortAttributes: true,
// removeEmptyAttributes: true,
removeAttributeQuotes: false,
minifyJS: terserOptions,
minifyCSS: {
level: 2,
},
},
},
Image: import.meta.env.PROD,
// shows true or false
JavaScript: { terser: terserOptions },
SVG: {
svgo: {
// plugins: [
// {
// inlineStyles: false,
// },
// ],
},
},
}),
sitemap(),
// removeOriginalImages(),
],
// Docs for responsiveImages https://docs.astro.build/en/reference/experimental-flags/responsive-images/
// image: {
// experimentalLayout: 'responsive',
// },
experimental: {
// contentLayer: true,
responsiveImages: true,
svg: true,
},
});