diff --git a/next.config.js b/next.config.js index 5f96002..a019c87 100644 --- a/next.config.js +++ b/next.config.js @@ -4,6 +4,7 @@ const nextConfig = { output: 'standalone', generateEtags: false, allowedDevOrigins: ['192.168.1.10'], + // Не используем outputFileTracingRoot для корректной работы standalone режима webpack: (config, { isServer }) => { // Исключаем fs и path из клиентской сборки if (!isServer) { diff --git a/scripts/install.sh b/scripts/install.sh index 830472b..5e98b68 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -242,11 +242,13 @@ if [ -d "$INSTALL_DIR/.next/standalone" ]; then # Copy public directory to standalone (always update) if [ -d "$INSTALL_DIR/public" ]; then echo -e "${YELLOW}Copying public directory to standalone...${NC}" + rm -rf "$INSTALL_DIR/.next/standalone/public" 2>/dev/null || true cp -r "$INSTALL_DIR/public" "$INSTALL_DIR/.next/standalone/public" 2>/dev/null || true fi # Copy .next/static to standalone/.next/static (always update) if [ -d "$INSTALL_DIR/.next/static" ]; then echo -e "${YELLOW}Copying .next/static to standalone...${NC}" + rm -rf "$INSTALL_DIR/.next/standalone/.next/static" 2>/dev/null || true mkdir -p "$INSTALL_DIR/.next/standalone/.next" cp -r "$INSTALL_DIR/.next/static" "$INSTALL_DIR/.next/standalone/.next/static" 2>/dev/null || true else