Skip to content

Angular Production Build: Not able to remove the Dependencies Details from angular Build generated main[hash].js file #25568

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

Closed
1 task
neil26 opened this issue Jul 21, 2023 · 4 comments

Comments

@neil26
Copy link

neil26 commented Jul 21, 2023

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Hello Community,

I am Facing an issue in the Angular Production Build Generated main[hash].js file, the main file generated in builds shows all the information about dependencies, I have tried several things including custom-webpack, but I am unable to remove the details from the main.js file

image image

I want to remove the highlighted part from main[hash].js file generated with ng build --prod

Minimal Reproduction

generated the build using ng build --prod

checked main[hash].js file in browser, dependencies and devDependencies details are still there.

Exception or Error

To remove Dependencies or devDependencies from the angular prod / UAT build generated main[hash].js

Your Environment

Angular CLI: 7.3.0
Node: 10.19.0
OS: win32 x64
Angular: 7.2.3
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.13.0
@angular-devkit/build-angular      0.13.0
@angular-devkit/build-optimizer    0.13.0
@angular-devkit/build-webpack      0.13.0
@angular-devkit/core               7.3.0
@angular-devkit/schematics         7.3.0
@angular/cdk                       7.3.0
@angular/cli                       7.3.0
@angular/flex-layout               7.0.0-beta.19
@angular/material                  7.3.0
@angular/material-moment-adapter   9.1.3
@ngtools/webpack                   7.3.0
@schematics/angular                7.3.0
@schematics/update                 0.13.0
rxjs                               6.4.0
typescript                         3.2.4
webpack                            4.29.0

Anything else relevant?

No response

@JeanMeche
Copy link
Member

The support for v7 was dropped long time ago. Please update your stack before opening a support request.

@neil26
Copy link
Author

neil26 commented Jul 21, 2023

@JeanMeche I Know, but this project is in Production and has some dependencies due to which I cannot upgrade the stack, appreciate it if you could provide any solution.

@clydin
Copy link
Member

clydin commented Jul 21, 2023

For license comments in the output chunks, the extractLicenses option can be used (enabled by default in production for newly generated projects).

As to the package.json content in the output chunks, the application code itself is most likely importing the project's package.json. This is something that would need to be fixed within the application's code and not the Angular CLI.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants