Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3rdpartylicenses.txt is being created in the wrong folder #28852

Open
davidgeary opened this issue Nov 13, 2024 · 2 comments
Open

3rdpartylicenses.txt is being created in the wrong folder #28852

davidgeary opened this issue Nov 13, 2024 · 2 comments
Labels
needs: more info Reporter must clarify the issue

Comments

@davidgeary
Copy link

The CLI build process creates the file 3rdpartylicenses.txt when the configuration is set to 'production' or includes "extractLicenses": true.

Prior to the new build system, 3rdpartylicenses.txt was saved to the root of the build output, typically .\dist\my-project. This allowed it to be included by default in any distribution.

With the introduction of the new build system, the build process now saves the compiled output to .\dist\my-project\browser, but 3rdpartylicenses.txt is still being saved to .\dist\my-project, meaning that it is no longer included with the project output. If it needs to be distributed as part of the application, it now needs an additional build step to copy it into the browser subfolder.

Expected behavior
Under the new build system, 3rdpartylicenses.txt should be saved to the root of the same folder as the compiled output.

Steps to reproduce

ng new extract-licenses --style=css --skip-git=true
cd extract-licenses
ng build --configuration=production
dir .\dist\extract-licenses

This should display 3rdpartylicenses.txt and the browser folder. (Listing the contents of the browser folder will list the application files.)

Output from ng version:

Angular CLI: 18.2.11
Node: 20.14.0
Package Manager: npm 10.7.0
OS: win32 x64

Angular: 18.2.11
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1802.11
@angular-devkit/build-angular   18.2.11
@angular-devkit/core            18.2.11
@angular-devkit/schematics      18.2.11
@schematics/angular             18.2.11
rxjs                            7.8.1
typescript                      5.5.4
zone.js                         0.14.10
@alan-agius4
Copy link
Collaborator

This is working as intended, this file is not meant
to be servable.

What is the use case of needed this to be servable?

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Nov 13, 2024
@davidgeary
Copy link
Author

I don't necessarily need it to be servable, I just want it to be included in the application's files for
distribution.

[That said, it's entirely possible that an application may wish to include/display the contents of 3rdpartylicenses.txt alongside its own licence somewhere. But being able to display or serve the file directly is not the issue here; just the ability to have it included in the output folder.]

A number of licences include a provision requiring copyright notices, etc, to be included in the final software product; for example, the MIT licence states:

"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software."

This may often be ignored when building server-hosted web apps (because the developer manages all copies of the final application), but when Angular is used to build, say, mobile apps, e.g. using Ionic, the software is being distributed to each end user. In these circumstances, the developer is required to provide a copy of the licence(s) as part of the application and AIUI, including 3rdpartylicenses.txt with the compiled output would satisfy that requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: more info Reporter must clarify the issue
Projects
None yet
Development

No branches or pull requests

2 participants