Firebase Studio มีสภาพแวดล้อมการพัฒนาบนระบบคลาวด์ที่ทำงานร่วมกันได้
ซึ่งช่วยลดความซับซ้อนของกระบวนการสร้างแอปพลิเคชันด้วย
การผสมผสานเฟรมเวิร์กและไลบรารีที่หลากหลาย
ดูตัวอย่างไฟล์ .idx/dev.nix ต่อไปนี้สำหรับการกำหนดค่าสภาพแวดล้อมพื้นที่ทำงานพื้นฐาน
ที่เปิดใช้ตัวอย่างแอปใน Firebase Studio
{ pkgs,...}:{# Which nixpkgs channel to use.channel="stable-23.11";# or "unstable"# Use https://search.nixos.org/packages to find packagespackages=[
pkgs.nodejs_20
];# Sets environment variables in the workspaceenv={SOME_ENV_VAR="hello";};# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
idx.extensions=["angular.ng-template"];# Enable previews and customize configuration
idx.previews={enable=true;previews={web={command=["npm""run""start""--""--port""$PORT""--host""0.0.0.0""--disable-host-check"];manager="web";# Optionally, specify a directory that contains your web app# cwd = "app/client";};};};}
ใช้การกำหนดค่าใหม่
เมื่อใดก็ตามที่คุณเพิ่มหรืออัปเดตdev.nixไฟล์การกำหนดค่า Firebase Studio
จะแสดงข้อความแจ้งที่มุมขวาล่างเพื่อสร้างสภาพแวดล้อมใหม่
ระยะเวลาที่ใช้ในการสร้างสภาพแวดล้อมใหม่จะขึ้นอยู่กับจำนวนแพ็กเกจที่การกำหนดค่าของคุณต้องการ
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-08-08 UTC"],[],[],null,["Firebase Studio provides a collaborative, cloud-based development\nenvironment that simplifies the process of building applications with an\nextensive combination of\n[frameworks and libraries](https://studio.firebase.google.com/templates).\n\nAfter you set up a Firebase Studio workspace, you can access and share a\nfully-functional, flexible development environment:\nFirebase Studio workspaces are accessible from any device and provide\nintegrated tools to streamline you and your team's development process.\n\nCreate a workspace\n\nA workspace in Firebase Studio is a development environment that\ncontains everything you need to develop your application. It contains your\ncode, a code editor (with plugins relevant to your project), and toolchains\nthat support app development. It's just like creating a new project in your\nlocal desktop development environment, except you have an entire computer\nand operating system pre-configured and dedicated *exclusively* to building\nyour application, running on your browser in the cloud, accessible wherever\nyou are.\n\nFirebase Studio workspaces are optimized to contain a single codebase,\nso you can keep the environments and system-level dependencies of different\napplications isolated from each other. You can create multiple workspaces to\nuse with different applications and frameworks.\n| **Key Point:** There's a limit to the number of workspaces you can create. If you have a [Google Developer Profile](https://developers.google.com/profile/help/overview), you can create more workspaces. Learn more at [Firebase Studio pricing, quotas and limits](/docs/studio/pricing).\n\nTo create a new workspace:\n\n- [Opening a template or sample app](/docs/studio/get-started-template).\n- [Importing a project](/docs/studio/get-started-import).\n- [Prototype with AI](/docs/studio/get-started-ai), then switch to Code view (**`\u003c/\u003e`**).\n\nDuplicate a workspace\n\nDuplicating a Firebase Studio workspace creates a copy of your project that\ncontains everything within the `home/user` directory. This is useful when you\nwant to experiment with a project without affecting the original, or when you\nwant to use an existing project as a starting point for a new one.\n\nTo duplicate a workspace:\n\n1. From the [Firebase Studio homepage](https://studio.firebase.google.com/), click the more_horiz menu next to the workspace you want to copy \\\u003e **Duplicate**.\n2. Enter the name of your new workspace and click **Duplicate**. The new\n workspace is created and added to your list of workspaces.\n ß\n Note: Duplicating larger workspaces can take several minutes. If your new\n workspace doesn't load, wait 5 minutes, then refresh the page.\n\n3. *(Optional)* If the original workspace has a linked Firebase project,\n consider creating a separate Firebase project for your new workspace. This\n prevents your new workspace from making changes to the Firebase project\n linked to your original workspace. To create a Firebase project:\n\n 1. Open the new workspace and ask Gemini to create a Firebase project for you.\n 2. Update any files that reference the Firebase project, such as `.env` or `.firebaserc`.\n\nConfigure your workspace\n\nFirebase Studio uses\n[Nix](https://nixos.org/manual/nix/stable/introduction)\nto define the environment configuration for each workspace. Nix is a purely\nfunctional package manager and assigns unique identifiers to each\ndependency, which ultimately means your environment can contain multiple\nversions of the same dependency, seamlessly. It is also reproducible and\ndeclarative. In the context of Firebase Studio, this means you can\nshare your Nix configuration file across workspaces to load the same\nenvironment configuration. Learn more about [Nix +\nFirebase Studio](/docs/studio/customize-workspace#nix+fs).\n\nCreate or edit the `.idx/dev.nix` file\n\nEnvironment configuration is defined in the `.idx/dev.nix` file in your code\nrepository. This file specifies all of the components to be added to your\nworkspace including:\n\n- [System tools](/docs/studio/customize-workspace#system-tools)\n available from the\n [Nix package registry](https://search.nixos.org/packages),\n including compilers, packages (like `go` or `angular`), and command line\n utilities, like extra\n [gcloud CLI components](/docs/studio/customize-workspace#gcloud).\n\n- [IDE extensions](/docs/studio/customize-workspace#extensions) from the\n [OpenVSX registry](https://open-vsx.org/), like\n language-specific debuggers, code formatters, official extensions for cloud\n services, and more.\n\n- [Common services](/docs/studio/customize-workspace#common-services), like\n docker, Pub/Sub messaging, databases like Postgres and Redis, and\n [more](/docs/studio/devnix-reference).\n\nSee the following example `.idx/dev.nix` file for a basic workspace environment\nconfiguration that enables app previews in Firebase Studio: \n\n { pkgs, ... }: {\n\n # Which nixpkgs channel to use.\n channel = \"stable-23.11\"; # or \"unstable\"\n\n # Use https://search.nixos.org/packages to find packages\n packages = [\n pkgs.nodejs_20\n ];\n\n # Sets environment variables in the workspace\n env = {\n SOME_ENV_VAR = \"hello\";\n };\n\n # Search for the extensions you want on https://open-vsx.org/ and use \"publisher.id\"\n idx.extensions = [\n \"angular.ng-template\"\n ];\n\n # Enable previews and customize configuration\n idx.previews = {\n enable = true;\n previews = {\n web = {\n command = [\n \"npm\"\n \"run\"\n \"start\"\n \"--\"\n \"--port\"\n \"$PORT\"\n \"--host\"\n \"0.0.0.0\"\n \"--disable-host-check\"\n ];\n manager = \"web\";\n # Optionally, specify a directory that contains your web app\n # cwd = \"app/client\";\n };\n };\n };\n }\n\nApply new configuration\n\nAny time you add or update the `dev.nix` configuration file, Firebase Studio\nshows a prompt in the bottom-right corner to **Rebuild the environment**.\nThe time it takes to rebuild the environment depends on the number of packages\nyour configuration needs.\n\nDebug environment build failures\n\nBecause configuration files are machine-readable code, they can have\nerrors. If this happens, the environment may fail to build and not start.\nFirebase Studio displays an option to start a *Recovery* environment.\nThis workspace doesn't include any of the configuration you've defined and\njust runs basic\nCode OSS. This gives you the chance to fix errors in your\n`dev.nix` configuration file and rebuild the environment.\n\nNext steps\n\n- [Customize your\n Firebase Studio workspace](/docs/studio/customize-workspace).\n\n- [Create custom templates to use and share](/docs/studio/custom-templates).\n\n- [Share your workspace](/docs/studio/share-your-workspace).\n\n- [Use an \"Open in Firebase Studio\" button to share your workspace\n configuration or custom template](/docs/studio/open-in-firebase-studio)."]]