Optional: Abrechnung für Ihr Firebase-Projekt aktiviert (erforderlich, wenn Sie SSR verwenden möchten)
Firebase initialisieren
Initialisieren Sie zuerst Firebase für Ihr Framework-Projekt.
Verwenden Sie die Firebase CLI für ein neues Projekt oder ändern Sie firebase.json für ein vorhandenes Projekt.
Neues Projekt initialisieren
Aktivieren Sie in der Firebase CLI die Vorschau für Web-Frameworks:
firebase experiments:enable webframeworks
Führen Sie den Initialisierungsbefehl über die CLI aus und folgen Sie dann der Anleitung:
firebase init hosting
Antworten Sie mit „Ja“ auf die Frage „Möchten Sie ein Web-Framework verwenden? (experimentell)“
Wählen Sie das Hosting-Quellverzeichnis aus. Das kann eine vorhandene Flutter-App sein.
Wählen Sie bei Aufforderung „Flutter Web“ aus.
Vorhandenes Projekt initialisieren
Ändern Sie die Hosting-Konfiguration in firebase.json so, dass sie die Option source anstelle der Option public enthält. Beispiel:
[null,null,["Zuletzt aktualisiert: 2025-08-08 (UTC)."],[],[],null,["\u003cbr /\u003e\n\nWith the Firebase framework-aware CLI, you can deploy your Flutter application\nto Firebase.\n| **Note:** Framework-aware Hosting is an early public preview. This means that the functionality might change in backward-incompatible ways. A preview release is not subject to any SLA or deprecation policy and may receive limited or no support.\n\nBefore you begin\n\nBefore you get started deploying your app to Firebase,\nreview the following requirements and options:\n\n- Firebase CLI version 12.1.0 or later. Make sure to [install the CLI](/docs/cli#install_the_firebase_cli) using your preferred method.\n- Optional: Billing enabled on your Firebase project (required if you plan to use SSR)\n\nInitialize Firebase\n\nTo get started, initialize Firebase for your framework project.\nUse the Firebase CLI for a new project, or modify `firebase.json` for an\nexisting project.\n\nInitialize a new project\n\n1. In the Firebase CLI, enable the web frameworks preview: \n\n ```\n firebase experiments:enable webframeworks\n ```\n2. Run the initialization command from the CLI and then follow the prompts:\n\n ```\n firebase init hosting\n ```\n\n \u003cbr /\u003e\n\n3. Answer yes to \"Do you want to use a web framework? (experimental)\"\n\n4. Choose your hosting source directory; this could be an existing Flutter app.\n\n5. If prompted, choose Flutter Web.\n\nInitialize an existing project\n\nChange your hosting config in `firebase.json` to have a `source` option, rather\nthan a `public` option. For example: \n\n {\n \"hosting\": {\n \"source\": \"./path-to-your-flutter-app\"\n }\n }\n\nServe static content\n\nAfter initializing Firebase, you can serve static content with the standard\ndeployment command: \n\n firebase deploy"]]