question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

๐Ÿ› I'd like my console.log statements to stay intact please ๐Ÿ˜…

See original GitHub issue

๐Ÿ› report

even with a .uglifyrc that looks like:

{
  "compress": {
    "drop_console": false
  }
}

It still seems to strip console.log statements when I run parcel build through the CLI.

As an example, pull the console branch of this repo and run npm run build.

The code that ends up in dist does not include any console.log

It causes no errors, just doesnโ€™t seem to pick up the config file at all.

Love parcel though โค๏ธ

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
HenrikJoretegcommented, Jan 25, 2018

I think it would make sense to change the default to be non-destructive. It certainly caught me off guard and took me a little bit to figure out. I didnโ€™t expect minification to change behavior.

Also the config, if it exists needs to be used, but thatโ€™s a different issue.

0reactions
HenrikJoretegcommented, Jan 26, 2018

@devongovett @DeMoorJasper thanks! โค๏ธ

Read more comments on GitHub >

github_iconTop Results From Across the Web

console.log() - Web APIs - MDN Web Docs
The console.log() method outputs a message to the web console. The message may be a single string (with optional substitution values),ย ...
Read more >
Bad idea to leave "console.log()" calls in your production ...
I'd like to just leave them there, so I don't have to go to the trouble of re-adding the comments later on if...
Read more >
Please Stop Using console.log() for Debugging โ€” It's Broken
log () when the console is not yet active only results in a reference to the object being queued, not the output the...
Read more >
Hide ๐Ÿ™ˆ all console logs in production with just 3 lines of code
We basically use the console.log() in our JS application to check wether our code is working properly or to replicate the bug or...
Read more >
{solved} console.log() bug problems
Error message: ... Explanation: console.log() is a function, it will log/print on the console/screen the message you put in the ( ) ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found