astro.config.mjs — astro Source File
Architecture documentation for astro.config.mjs, a javascript file in the astro codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 56281696_2c7e_dc09_3e67_0b75cc4cdaca["astro.config.mjs"] b05fd4c1_a3ee_3301_adcd_43b49bae78f1["mdx"] 56281696_2c7e_dc09_3e67_0b75cc4cdaca --> b05fd4c1_a3ee_3301_adcd_43b49bae78f1 3b10c06c_a805_be1f_3a3d_1f00ea858ef5["config"] 56281696_2c7e_dc09_3e67_0b75cc4cdaca --> 3b10c06c_a805_be1f_3a3d_1f00ea858ef5 d9a92db9_c95e_9165_13ac_24b3d859d946["node:url"] 56281696_2c7e_dc09_3e67_0b75cc4cdaca --> d9a92db9_c95e_9165_13ac_24b3d859d946 style 56281696_2c7e_dc09_3e67_0b75cc4cdaca fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import mdx from '@astrojs/mdx';
import { defineConfig } from 'astro/config';
import { fileURLToPath } from 'node:url';
export default defineConfig({
name: 'Astro content layer',
integrations: [mdx(), {
name: '@astrojs/my-integration',
hooks: {
'astro:server:setup': async ({ server, refreshContent }) => {
server.middlewares.use('/_refresh', async (req, res) => {
if(req.method !== 'POST') {
res.statusCode = 405
res.end('Method Not Allowed');
return
}
let body = '';
req.on('data', chunk => {
body += chunk.toString();
});
req.on('end', async () => {
try {
const webhookBody = JSON.parse(body);
await refreshContent({
context: { webhookBody },
loaders: ['increment-loader']
});
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ message: 'Content refreshed successfully' }));
} catch (error) {
res.writeHead(500, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ error: 'Failed to refresh content: ' + error.message }));
}
});
});
}
}
}],
vite: {
resolve: {
alias: {
'@images': fileURLToPath(new URL('./images', import.meta.url))
}
},
},
experimental: {
contentIntellisense: true,
},
});
Dependencies
- config
- mdx
- node:url
Source
Frequently Asked Questions
What does astro.config.mjs do?
astro.config.mjs is a source file in the astro codebase, written in javascript.
What does astro.config.mjs depend on?
astro.config.mjs imports 3 module(s): config, mdx, node:url.
Where is astro.config.mjs in the architecture?
astro.config.mjs is located at packages/astro/test/fixtures/content-layer/astro.config.mjs (directory: packages/astro/test/fixtures/content-layer).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free