Repository navigation
fix(@schematics/angular): migrate secondary entry point style options in use-library-builder - #34468
Merged
Merged
Conversation
… in use-library-builder migration read only `lib.entryFile` from secondary `ng-package.json` and then deleted it, so its `styleIncludePaths` and `sass` options were lost and next build failed with `Can't find stylesheet to import` library builder has single global `stylePreprocessorOptions`, so secondary optoins are now merged into it next to primary ones
There was a problem hiding this comment.
Code Review
This pull request updates the use-library-builder migration schematic to collect and merge styleIncludePaths and sass options from secondary entry points. Feedback on the changes highlights an issue where existing sass options in the workspace configuration (angular.json) are overwritten rather than merged, and a code suggestion is provided to preserve and merge these existing options.
alan-agius4
requested changes
Oct 21, 2026
…options in use-library-builder Co-authored-by: Alan Agius <alanagius@google.com>
alan-agius4
approved these changes
Oct 21, 2026
Member
|
This PR was merged into the repository. The changes were merged into the following branches:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
PR Type
What is the current behavior?
Issue Number: N/A
use-library-builderdrops style options of secondary entry pointsng-packagr's own
scss-pathssample shows it:sub-module/ng-package.jsonhas ownstyleIncludePaths, after migrationsub-module/assetsis just gone fromincludePathsfindSecondaryEntryPointsreads onlylib.entryFilefrom secondary config and then file is deleted, sostyleIncludePathsandsassset per entry point are lost (primary ones are migrated)Small workspace with
sub/ng-package.jsonsetting"styleIncludePaths": ["../styles", "./styles"]builds fine with ng-packagr, after migrationng buildfails:Secondary
sass.silenceDeprecationsis lost too, so@importdeprecation warning comes backWhat is the new behavior?
Library builder has one global
stylePreprocessorOptions, so include paths of secondary entry points are resolved from their own diretory and merged intoincludePathsafter primary ones, duplicates removedsassdeprecation lists of all entry points are merged same waySame workspace builds after migration (both packages built from this branch) and styles in output match ng-packagr build
New case in
migration_spec.tssetsstyleIncludePathsandsasson primary and ontestingentry point, it fails on mainDoes this PR introduce a breaking change?
Other information
Because options become global, partial with same name in two include paths now resolves to first one for every entry point
If you prefer warning for secondary options instead of merging, I can switch to that
Also
lib.cssUrl: "none"is dropped without any message, library builder always inlines relativeurl()as data URI and has no such optionShould migration warn about it? Can add it here or in seperate PR