Upgrade to Astro v7
Este conteúdo não está disponível em sua língua ainda.
Copy this prompt to upgrade your project:
Upgrade my Astro project to v7. Follow the migration guide athttps://v7.docs.astro.build/en/guides/upgrade-to/v7/This guide will help you migrate from Astro v6 to Astro v7.
Need to upgrade an older project to v6 first? See our older migration guide.
Need to see the v6 docs? Visit this older version of the docs site (unmaintained v6 snapshot).
Upgrade Astro
Section titled “Upgrade Astro”Update your project’s version of Astro to the latest version using your package manager:
# Upgrade Astro and official integrations togethernpx @astrojs/upgrade alpha# Upgrade Astro and official integrations togetherpnpm dlx @astrojs/upgrade alpha# Upgrade Astro and official integrations togetheryarn dlx @astrojs/upgrade alphaYou can also upgrade your Astro integrations manually if needed, and you may also need to upgrade other dependencies in your project.
After upgrading Astro, you may not need to make any changes to your project at all!
But, if you notice errors or unexpected behavior, please check below for what has changed that might need updating in your project.
Astro v7.0 includes potentially breaking changes, as well as the removal of some previously deprecated features.
If your project doesn’t work as expected after upgrading to v7.0, check this guide for an overview of all breaking changes and instructions on how to update your codebase.
See the Astro changelog for full release notes.
Breaking Changes
Section titled “Breaking Changes”Dependency Upgrades
Section titled “Dependency Upgrades”Vite 8
Section titled “Vite 8”Astro v7.0 upgrades to Vite 8 as the development server and production bundler.
What should I do?
Section titled “What should I do?”If you are using Vite-specific plugins, configuration, or APIs, check the Vite 8 migration guide for their breaking changes and upgrade your project as needed.
Most Astro users should be able to upgrade without any changes to their project code. This is primarily a breaking change for Astro integrations and plugins that depend on Vite internals.
Rust Compiler
Section titled “Rust Compiler”The Rust-based Astro compiler, previously available as an experimental flag (experimental.rustCompiler), is now the default and only compiler in Astro 7. The Rust compiler delivers significantly faster build times compared to the previous Go-based compiler.
What should I do?
Section titled “What should I do?”No action is required for most projects. The Rust compiler is a drop-in replacement for the Go-based compiler.
If you had previously opted in to the Rust compiler via the experimental flag, you can now remove it from your configuration:
import { defineConfig } from 'astro/config';
export default defineConfig({ experimental: { rustCompiler: true, },});If you encounter any issues with the Rust compiler, please report them on GitHub.
Upgrade Guides