mirror of
https://github.com/remvze/moodist.git
synced 2025-12-19 01:44:15 +00:00
- 新增 Dockerfile.dev-server:类生产模式容器(无热重载干扰) - 新增 Dockerfile.prod-like:纯生产模式容器尝试 - 新增 Dockerfile.server:服务器模式容器 - 更新 docker-compose.yml:移除过时 version 字段,优化卷挂载 - 更新 .gitignore:忽略 data 目录(SQLite 数据库) - 更新 astro.config.mjs:支持服务器端渲染模式 这解决了 react-icons 在生产构建中的 ES 模块兼容性问题, 提供了稳定的生产级 Docker 部署方案。
46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
import { defineConfig } from 'astro/config';
|
|
|
|
import react from '@astrojs/react';
|
|
import node from '@astrojs/node';
|
|
import AstroPWA from '@vite-pwa/astro';
|
|
|
|
export default defineConfig({
|
|
output: 'server',
|
|
adapter: node({
|
|
mode: 'standalone'
|
|
}),
|
|
integrations: [
|
|
react(),
|
|
AstroPWA({
|
|
manifest: {
|
|
background_color: '#09090b',
|
|
description: 'Ambient sounds for focus and calm.',
|
|
display: 'standalone',
|
|
icons: [
|
|
...[72, 128, 144, 152, 192, 256, 512].map(size => ({
|
|
sizes: `${size}x${size}`,
|
|
src: `/assets/pwa/${size}.png`,
|
|
type: 'image/png',
|
|
})),
|
|
],
|
|
name: 'Moodist',
|
|
orientation: 'any',
|
|
scope: '/',
|
|
short_name: 'Moodist',
|
|
start_url: '/',
|
|
theme_color: '#09090b',
|
|
},
|
|
registerType: 'prompt',
|
|
workbox: {
|
|
globPatterns: ['**/*'],
|
|
maximumFileSizeToCacheInBytes: Number.MAX_SAFE_INTEGER,
|
|
navigateFallback: '/',
|
|
},
|
|
}),
|
|
],
|
|
vite: {
|
|
define: {
|
|
global: 'globalThis',
|
|
},
|
|
},
|
|
});
|