I am managing an Angular CLI project that consists of two identical apps. However, one app requires the exclusion of a specific module in its build process.
Key Details:
- Angular CLI Version: 1.7.4
- Angular Version: 5.2.10
In the angular-cli.json file, I have configured two separate apps, each with its own ts-config file.
"apps": [
{
"name": "app", <---- first app
...
"tsconfig": "tsconfig.app.json", <----first TS config
...
},
{
"name": "admin", <---- second app
...
"tsconfig": "tsconfig.admin.json", <----- second ts config
...
}
],
The "admin" app builds all files, while the "app" excludes the admin module during its build process as specified in tsconfig.app.json.
During testing, after making changes to the admin module and running the build locally, it was observed that the "app" version did not exclude the admin module as intended.
To address this issue, I set up custom "ng-build" scripts in the package.json file for each app:
"scripts": {
"build-app": "ng build -app app --prod",
"build-admin": "ng build -app admin --prod",
},
If anyone has encountered similar challenges or has potential solutions to resolve this issue, kindly share your insights.
Although the corresponding GitHub issue on the angular-cli repository has been closed without a resolution provided, you can still view it here: See Issue Here