angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

AOT plugin basePath option support

Open be4code opened this issue 9 years ago • 2 comments

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Desired functionality.

Both serve and build tasks should allow to override AOT plugin's basePath option which is currently resolved from tsconfig. It would be useful when user has architecture like this:

module-name
|
+-- service
|    | pom.xml
|    | src
+-- web
|    | *.ts
+-- index.ts // barrell file
webapp
|
+-- src
|    | app.module.ts
|    | main.ts
|    | tsconfig.app.json
.angular-cli.json
tsconfig.json

The log given by the failure.

Currently there is no chance to have AOT working properly. User receives similar errors to these below:

ERROR in /someAbsolutePath/webapp/src/$$_gendir/module/chat/web/chat.module.ngfactory.ts (10,21): Cannot find module './chat.module'. ERROR in /someAbsolutePath/webapp/src/$$_gendir/module/chat/web/chat.module.ngfactory.ts (27,22): Cannot find module '../../web-utils/web/notification.service'. ERROR in /someAbsolutePath/webapp/src/$$_gendir/module/chat/web/chat.module.ngfactory.ts (29,22): Cannot find module '../../web-utils/web/access.service'. ERROR in /someAbsolutePath/webapp/src/$$_gendir/module/chat/web/chat.module.ngfactory.ts (31,22): Cannot find module '../../web-utils/web/products.service'. ERROR in /someAbsolutePath/webapp/src/$$_gendir/module/chat/web/chat.module.ngfactory.ts (32,22): Cannot find module '../../web-utils/web/table-config'. ERROR in /someAbsolutePath/webapp/src/$$_gendir/module/chat/web/chat.module.ngfactory.ts (35,22): Cannot find module './chat.service'. ERROR in /someAbsolutePath/webapp/src/$$_gendir/module/chat/web/chat.module.ngfactory.ts (40,22): Cannot find module '../../web-utils/web/utils.module'. ERROR in ./webapp/src/$$_gendir async Module not found: Error: Can't resolve '/someAbsolutePath/webapp/module/home/web/home.module.ngfactory.ts' in '/someAbsolutePath/webapp/src/$$_gendir' @ ./webapp/src/$$_gendir async @ ./~/@angular/core/@angular/core.es5.js @ ./webapp/src/main.ts @ multi ./webapp/src/main.ts

While, i.e. ChatModule, exists in /someAbsolutePath/module/chat/web/chat.module.ts. Error is caused by basePath resolved to webapp/src.

be4code avatar Aug 08 '17 15:08 be4code

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

alan-agius4 avatar Jan 08 '19 06:01 alan-agius4

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.