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.

Why does environment defaults to development and not production?

See original GitHub issue

This is my browserslist config:

"browserslist": {
  "production": [
    "last 2 versions",
    "ie 11"
  ],
  "development": [
    "last 1 Chrome version"
  ]
}

My use-case is that I have a staging NODE_ENV which compiles my app as it was production, but doesn’t uglify the code and uses sourcemaps. And of course I wanted to use the production browserlist.

Instinctively, I thought that if my NODE_ENV didn’t match any of the two options, it would default to production, but instead it defaults to development.

https://github.com/ai/browserslist/blob/64e9c07b6186d5eb4cfdeb8b5e3dc9c2bc6c8b43/node.js#L61

What did bring you to that decision? I think it can be reconsidered since the development environment is always one and only, instead you can have multiple production environments, say test or whatever else, where you would need to use the production browserslist, since it isn’t viewed only by your development browser.

What do you think?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
aicommented, Feb 8, 2018

I will release 3.0 when Jest release my Node.js fix

0reactions
aicommented, Feb 10, 2018

Released in 3.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment Variables and Why You Shouldn't Use Them
Using environment variables is a somewhat common practice during Development but it is actually not a healthy practice to use with Production.
Read more >
Should default configuration for deployed services be set as ...
More often than not, developer's environment is not compatible with production because not every component is set up by each developer nor is...
Read more >
Node.js, the difference between development and production
Node.js assumes it's always running in a development environment. You can signal Node.js that you are running in production by setting the NODE_ENV=production ......
Read more >
Common Configuration Differences Between Development ...
Deploying a site to production entails copying all of the files to the production server in the development environment except for the Web....
Read more >
What Are Environment Variables and How Can I Use Them ...
... development and production environment. How can we configure this so we don't have to directly edit our code to change our environment?...
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