angular-cli
angular-cli copied to clipboard
Extract license should scan paths outside of node_modules
Command
build
Description
Currently with the extractLicenses
set to true
, the license files of the referenced packages are collected and extracted into the 3rdpartylicenses.txt
file. This is correct so far, however consider the following use-case:
To avoid using 3rd party hosts, fonts and icons (e.g. Roboto and Material Symbols) can be self-hosted. Instead of using a separate http server to serve these files, one can include them in an Angular application. We put the font files, their corresponding licenses and @font-face
descriptor scss files in a directory under the application's root, something like this:
src/
app/
assets/
external/
roboto/*.woff
roboto/LICENSE.txt
roboto.scss
Unfortunately, these license files are not accumulated into the extracted license file. I don't really know well the builder source code but this check seems to be the one that filters the result: https://github.com/angular/angular-cli/blob/adba8beda52a30858d8666e5c154c912a9f57ebf/packages/angular_devkit/build_angular/src/tools/esbuild/license-extractor.ts#L83
Describe the solution you'd like
It would be nice if all possible license files would be combined into the single 3rdpartylicenses.txt
output file despite the location and the package-relevancy.
Describe alternatives you've considered
We could move these files into a separate npm package so the builder can pick up the license from there.
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.
You can find more details about the feature request process in our documentation.
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.