-
Notifications
You must be signed in to change notification settings - Fork 44
Complex structure
Ashleigh Simonelli edited this page Jan 28, 2019
·
1 revision
Now let's say that your application isn't located in a folder called src, but it's located in src/app
.
We want to be able to set a different 'root path' to load our configurations from. Be it src
or dist
.
Imagine a more complex project structure like this:
/
├── dist/
├── src/
│ ├── app/
│ │ ├── app.module.ts
│ │ └── bootstrap/
│ │ │ ├── index.ts
│ │ │ └── bootstrap.module.ts
│ ├── migrations/
│ ├── cli/
│ ├── config/
│ │ ├── app.ts
│ │ └── database.ts
│ └── main.ts
├── tsconfig.json
└── package.json
In this example, config files are located in the /src/config
folder, because they are shared between app, migrations and cli scripts.
Also during typescript compilation all files from src/
folder will be moved to the dist/
folder.
Moreover, the ConfigModule is imported in the BootstrapModule, but not directly in AppModule.