# 如何更改源文件目录

在使用dfx build命令编译项目的源代码之前，您可能需要检查用于存储程序源代码的默认位置。默认情况下，用于创建新项目的名称是用于一个数据Canister（canister\_name）和一个资源容器（canister\_name\_assets）的名称，并且程序源代码应位于src / canister\_name目录中。

但是，根据应用程序的复杂度和体系结构，您可能需要修改源代码的默认位置。

例如，对于一个简单的程序，您可能想要去掉一个目录层级，并将源代码放在src目录中：

**`"main": "src/main.mo"`**

对于更复杂的应用程序，您可能需要使用多层目录结构：

```
"canisters": {
 "profiles": {
 "main": "src/profiles/utils/main.mo"
 },
 "events": {
 "main": "src/events/calendar/main.mo"
 },
 "media": {
 "main": "src/events/reports/main.mo"
 }
}
```

提示：如果您修改源代码目录的默认设置，请确保dfx.json配置文件中的设置与文件系统上的目录位置匹配。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mixdao.gitbook.io/dfinity/san-shou-ba-shou/3.-guan-li-xiang-mu/ru-he-geng-gai-yuan-wen-jian-mu-lu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
