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

Silence UlgifyJS warnings #3068

Closed
mgol opened this issue Nov 8, 2016 · 4 comments
Closed

Silence UlgifyJS warnings #3068

mgol opened this issue Nov 8, 2016 · 4 comments

Comments

@mgol
Copy link
Member

mgol commented Nov 8, 2016

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

macOS Sierra 10.12.1 (16B2555)

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.19-3
node: 7.0.0
os: darwin x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

I just invoked:

ng new test-app
cd test-app
ng build --prod --aot

The log given by the failure.

Normally this include a stack trace and some more information.

Lots of warnings like:

WARNING in main.55f62913a98db261318d.bundle.js from UglifyJs
Dropping unused function isStrictStringMap [/Users/mgol/Workspace/angular2-test/test-app/~/@angular/core/src/facade/lang.js:44,0]
Dropping unused function isDate [/Users/mgol/Workspace/angular2-test/test-app/~/@angular/core/src/facade/lang.js:47,0]
Dropping unused function setValueOnPath [/Users/mgol/Workspace/angular2-test/test-app/~/@angular/core/src/facade/lang.js:112,0]
Dropping unused function escapeRegExp [/Users/mgol/Workspace/angular2-test/test-app/~/@angular/core/src/facade/lang.js:152,0]
Side effects in initialization of unused variable STRING_MAP_PROTO [/Users/mgol/Workspace/angular2-test/test-app/~/@angular/core/src/facade/lang.js:43,0]
Side effects in initialization of unused variable NumberWrapper [/Users/mgol/Workspace/angular2-test/test-app/~/@angular/core/src/facade/lang.js:67,0]
Dropping unused function setDOM [/Users/mgol/Workspace/angular2-test/test-app/~/@angular/platform-browser/src/dom/dom_adapter.js:12,0]
Dropping unused function scheduleMicroTask [/Users/mgol/Workspace/angular2-test/test-app/~/@angular/common/src/facade/lang.js:21,0]
Dropping unused function isStrictStringMap [/Users/mgol/Workspace/angular2-test/test-app/~/@angular/common/src/facade/lang.js:44,0]
Dropping unused function looseIdentical [/Users/mgol/Workspace/angular2-test/test-app/~/@angular/common/src/facade/lang.js:100,0]

Mention any other details that might be useful.

UlgifyJS prints warnings for every piece of dead code it strips as it was a user error that some unneeded code is there. Maybe that's the case for a lot of regular projects but this is a pretty normal scenario for Angular's tree shaking. It'd be good to silence those warnings (but not potential errors) so that it doesn't look so unnecessary scary and so that it doesn't push the final Webpack output way beyond the screen.


Thanks! We'll be in touch soon.

@clydin
Copy link
Member

clydin commented Nov 8, 2016

In progress. See PR #2858

@filipesilva
Copy link
Contributor

Dupe of #1836 as well.

@krismeister
Copy link

I agree this would be nice. Our automated CI tools will fail if we put verbose mode on, because of the warnings.

@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 Sep 7, 2019
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

4 participants