forked from event-catalog/eventcatalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
57 lines (49 loc) · 1.57 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
import { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind';
import mdx from '@astrojs/mdx';
import react from '@astrojs/react';
import pagefind from 'astro-pagefind';
import { mermaid } from './src/remark-plugins/mermaid';
import { join } from 'node:path';
/** @type {import('bin/eventcatalog.config').Config} */
import config from './eventcatalog.config';
import expressiveCode from 'astro-expressive-code';
const projectDirectory = process.env.PROJECT_DIR || process.cwd();
const base = config.base || '/';
// https://astro.build/config
export default defineConfig({
base,
server: { port: config.port || 3000 },
outDir: join(projectDirectory, config.outDir || 'dist'),
// https://docs.astro.build/en/reference/configuration-reference/#site
site: config.homepageLink || 'https://eventcatalog.dev/',
// https://docs.astro.build/en/reference/configuration-reference/#trailingslash
trailingSlash: config.trailingSlash === true ? 'always' : 'ignore',
// just turn this off for all users (for now...)
devToolbar: { enabled: false },
integrations: [
react(),
tailwind(),
expressiveCode({
themes: ['github-light'],
defaultProps: {
// Enable word wrap by default
wrap: true,
},
}),
mdx({
// https://docs.astro.build/en/guides/integrations-guide/mdx/#optimize
optimize: config.mdxOptimize || false,
remarkPlugins: [mermaid],
gfm: false,
}),
pagefind(),
],
vite: {
build: {
commonjsOptions: {
transformMixedEsModules: true,
},
},
},
});