Overview
The Astro configuration file (astro.config.mjs) defines core settings for the Jowy Portfolio application, including site URL, development server options, integrations, and build configuration.
Configuration File
The complete configuration is located at the project root:Site Configuration
The production URL of your deployed site. This is used for:
- Generating absolute URLs in sitemaps
- Canonical URLs for SEO
- Social media meta tags
Example: Update Site URL
Vite Configuration
Array of Vite plugins. Jowy Portfolio uses the Tailwind CSS Vite plugin for styling.
The
@tailwindcss/vite plugin integrates Tailwind CSS v4 directly into the Vite build pipeline, providing faster builds and hot module replacement.Adding Vite Plugins
To add additional Vite plugins:Server Configuration
When set to
true, the dev server listens on 0.0.0.0, making it accessible from other devices on your network. Useful for testing on mobile devices.The port number for the development server. Default is
4321.Accessing Dev Server on Network
Withhost: true, you can access your dev server from other devices:
The network address will be displayed in your terminal when you start the dev server.
Custom Port
To change the development server port:Integrations
Jowy Portfolio includes two official Astro integrations:Array of Astro integrations to enable additional functionality.
Sitemap Integration
sitemap.xml file for your site based on the site configuration.
Benefits:
- Improves SEO by helping search engines discover all pages
- Automatically updates when you add/remove pages
- Respects i18n configuration for multi-language URLs
Sitemap Configuration Options
Sitemap Configuration Options
Compress Integration
- Reduces file sizes for faster page loads
- Minifies HTML, CSS, and JavaScript
- Improves Core Web Vitals scores
- Reduces bandwidth usage
Compress Configuration Options
Compress Configuration Options
Adding More Integrations
To add additional integrations:- Install the integration:
- Import and add to config:
Internationalization (i18n)
Configuration for Astro’s built-in i18n routing support.
i18n.config.ts for centralized language management.
For detailed i18n configuration, see the Internationalization guide.
TypeScript Configuration
The// @ts-check comment at the top of the file enables TypeScript checking for JavaScript files:
- Type checking for configuration options
- IntelliSense in compatible editors
- Catches configuration errors before runtime
Build Configuration
Astro’s default build settings are used, which:- Outputs to
dist/directory - Generates static HTML files
- Optimizes assets automatically
- Creates a production-ready build
Custom Build Output
To customize the build output directory:Environment-Specific Configuration
You can create different configurations for development and production:Common Configuration Tasks
Change Development Port
Update Production URL
Disable Compression in Development
Add Base Path for Subdirectory Deployment
Troubleshooting
Dev server won’t start
- Check for syntax errors in the config file
- Ensure all imported packages are installed
- Verify the port isn’t already in use
Sitemap not generating
- Verify the
siteoption is set correctly - Ensure the sitemap integration is included
- Check that pages are being built (not all dynamic)
Tailwind styles not applying
- Verify
@tailwindcss/viteis installed - Check that the plugin is in the
vite.pluginsarray - Ensure your Tailwind configuration file exists
i18n routes not working
- Confirm
i18n.config.tsexports match the imports - Verify page structure matches locale configuration
- Check routing options are correct for your use case