Bring back modern angular builder for dotcms-ui#34539
Conversation
❌ Issue Linking RequiredThis PR could not be linked to an issue. All PRs must be linked to an issue for tracking purposes. How to fix this:Option 1: Add keyword to PR body (Recommended - auto-removes this comment)
Why is this required?Issue linking ensures proper tracking, documentation, and helps maintain project history. It connects your code changes to the problem they solve.--- This comment was automatically generated by the issue linking workflow |
There was a problem hiding this comment.
Pull request overview
This PR updates the dotcms-ui Nx target configuration to use Angular’s modern application builder instead of the Nx browser-esbuild executor, aligning the app build with the Angular CLI-style builder setup.
Changes:
- Switch
dotcms-uibuild target executor to@angular-devkit/build-angular:application. - Reshape key build options (entrypoint key from
main→browser,polyfillsto array,outputPathto object form). - Remove previously configured global
scriptsentries (now an empty array).
| "executor": "@angular-devkit/build-angular:application", | ||
| "outputs": ["{options.outputPath.base}"], | ||
| "options": { | ||
| "baseHref": "./", | ||
| "outputPath": "dist/apps/dotcms-ui", | ||
| "outputPath": { | ||
| "base": "dist/apps/dotcms-ui", | ||
| "browser": "" | ||
| }, |
There was a problem hiding this comment.
outputs is set to {options.outputPath.base}, but outputPath is not consistently an object across configurations (e.g., development overrides it with a string). This can break Nx output tracking/caching and may fail option validation depending on the builder schema. Keep outputPath the same type in all configurations (either always a string, or always an object) and make outputs reference the correct path accordingly.
| "optimization": false, | ||
| "sourceMap": false, | ||
| "namedChunks": false, | ||
| "vendorChunk": true, | ||
| "buildOptimizer": false, | ||
| "extractLicenses": false, | ||
| "fileReplacements": [], |
There was a problem hiding this comment.
Because the base options.outputPath was changed to an object, this development configuration now overrides outputPath with a string, creating an inconsistent option type across configurations. This can lead to builder schema validation errors and also makes the target's outputs ({options.outputPath.base}) invalid for the development build. Align development.outputPath with the same object shape (or keep outputPath as a string everywhere).
Proposed Changes
Checklist
Additional Info
** any additional useful context or info **
Screenshots