Skip to content

Angular build options not working as expected for application-builder #30064

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
coder-ashwin opened this issue Apr 8, 2025 · 3 comments
Closed
Labels
needs: repro steps We cannot reproduce the issue with the information given

Comments

@coder-ashwin
Copy link

coder-ashwin commented Apr 8, 2025

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

I want to highlight 3 things when using the application-builder

  1. namedChunks: true
    The chunks of modules and standalone components are not getting named, its coming as chunk-hashValue.js

  2. outputHashing: false
    A hash value is being appended to main.js, styles.css, etc file names even tho I have set that property to false

  3. hash value in ngsw.json
    hash values of files which are not modified are changing. (This is working as expected for media files, if I make a change in a svg or something, only that file's hash value is changed and other file's hash value remains the same but that is not the case for code files). This is most likely due to points 1 and 2 but not sure

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.2.1
Node: 18.20.5
Package Manager: npm 10.8.2
OS: darwin arm64

Angular: 19.2.1
... animations, build, cli, common, compiler, compiler-cli, core
... forms, platform-browser, platform-browser-dynamic, router
... service-worker

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1902.1
@angular-devkit/core         19.2.1
@angular-devkit/schematics   19.2.1
@angular/cdk                 19.2.2
@angular/material            19.2.2
@schematics/angular          19.2.1
rxjs                         7.8.2
typescript                   5.7.3
zone.js                      0.15.0

Anything else?

Output after ng build:

Image
@JeanMeche JeanMeche transferred this issue from angular/angular Apr 8, 2025
@alan-agius4
Copy link
Collaborator

I took a look at this but wasn't able to replicate the issue. What I did observe is that when using namedChunks: true and outputHashing: false, the named chunks still include a hash, for example, home-F2O2GWHJ.js. This is expected behavior, as the hash helps prevent chunk name conflicts.

Regarding your point about file hashes changing even when files haven't been modified, I'm not quite sure I follow. From what I can see, file hashes only change when the file contents themselves have changed.

Can you setup a minimal repro please?

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

@alan-agius4 alan-agius4 added the needs: repro steps We cannot reproduce the issue with the information given label Apr 8, 2025
@coder-ashwin
Copy link
Author

coder-ashwin commented Apr 8, 2025

cool will setup a minimal repro in some time and update

regarding the file hashes, yes, I was expecting the hash to not change if the file contents are not changed but right now, in my project, if I do ng build twice without any change to any files whatsoever, all my code files's hashes changes even tho I didn't make any change.

@alan-agius4
Copy link
Collaborator

Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out our submission guidelines to understand why we can't act on issues that are lacking important information.

If the problem persists, please file a new issue and ensure you provide all of the required information when filling out the issue template.

@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: repro steps We cannot reproduce the issue with the information given
Projects
None yet
Development

No branches or pull requests

2 participants