-
Notifications
You must be signed in to change notification settings - Fork 12k
Multiple apps and shared components fails on --aot #8031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The error This error happens in your setup because you have two apps that share all the TS files. The files that each app contains are defined in The solution is to create separate tsconfig for each app, excluding the files specific to other apps.
|
Separated tsconfigs and excluding files was the key. Thank you! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/cli: 1.4.6
node: 8.5.0
os: darwin x64
@angular/animations: 4.4.4
@angular/common: 4.4.4
@angular/compiler: 4.4.4
@angular/core: 4.4.4
@angular/forms: 4.4.4
@angular/http: 4.4.4
@angular/platform-browser: 4.4.4
@angular/platform-browser-dynamic: 4.4.4
@angular/router: 4.4.4
@angular/cli: 1.4.6
@angular/compiler-cli: 4.4.4
@angular/language-service: 4.4.4
typescript: 2.3.4
Repro steps.
Create new application and add second application to apps array in angular-cli.json.
Add another main entry that shares components with default main.ts file.
Running ng build or serve with --aot flag produces build error.
The log given by the failure.
ERROR in Error: Type AppComponent in app.component.ts is part of the declarations of 2 modules
Desired functionality.
Using different apps with shared components would resolve excluding mocks from production code and add additional features for each app.
Mention any other details that might be useful.
Example repo: https://github.com/veke/ng-multiple-apps
ng build --aot
The text was updated successfully, but these errors were encountered: