generated from redte-ch/redte.ch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
46 lines (42 loc) · 1.29 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
import sitemap from '@astrojs/sitemap'
import svelte from '@astrojs/svelte'
import tailwind from '@astrojs/tailwind'
import { defineConfig } from 'astro/config'
import imageCompressor from 'astro-better-image-service'
import assetCompressor from 'astro-compressor'
import metadata from 'astro-meta-tags'
import insights from 'astro-page-insight'
import purgecss from 'astro-purgecss'
import assetMinifier from '@playform/compress'
import { FontaineTransform } from 'fontaine'
import app from './src/config/app.ts'
import assets from './src/config/assets.ts'
/** @type {'production' | 'development'} */
const mode = import.meta.env.PROD ? 'production' : 'development'
/** @type {import('astro').AstroUserConfig} */
// https://astro.build/config
export default defineConfig({
build: {
assets: assets[mode].output,
inlineStylesheets: assets[mode].inline
},
compressHTML: assets[mode].compression.HTML,
integrations: [
svelte(),
sitemap(app[mode].sitemap),
tailwind(),
/* @ts-ignore */
metadata(),
insights(),
purgecss(),
assetMinifier(assets[mode].compression),
imageCompressor(),
assetCompressor()
],
output: 'static',
site: app[mode].site,
trailingSlash: 'always',
vite: {
plugins: [FontaineTransform.vite(assets[mode].fonts(import.meta.url))]
}
})