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.

.browserslistrc being ignored from @babel/preset-env

See original GitHub issue

Current Behavior

I have a custom babel config:

{
  "presets": ["@babel/preset-env", "@babel/react", "@babel/typescript"],
  "plugins": ["@babel/plugin-transform-react-display-name", "@babel/plugin-proposal-object-rest-spread"]
}

and a .browserslistrc file with Edge 16 (among others)

The build step includes destructured object spread operators 😦

Expected behavior

The spread operators are transpiled down to something more acceptable for the browsers I want to use based off of .browserslistrc.

Suggested solution(s)

Fast track #634

Your environment

Software Version(s)
TSDX latest
TypeScript latest
Browser Edge 16
npm/Yarn yarn
Node v10.16.2
Operating System MacOS latest

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
agilgur5commented, Sep 20, 2020

Yes, I realize that, but I had also asked above https://github.com/formium/tsdx/issues/655#issuecomment-608589483 if .browserslistrc actually does work or not which never got a response. I was able to test this myself now so have a confirmation on that.

1reaction
kylemhcommented, Apr 28, 2020

thanks a ton @agilgur5 really helping me ❤️

hoping to get back to TSDX stuff soon

Read more comments on GitHub >

github_iconTop Results From Across the Web

Babel with babel-preset-env seems to ignore browserslist config
But, the problem is that Babel seems to ignore the browserslist key. The same is true if I use a .browserslistrc file containing:...
Read more >
babel/preset-env
babel /preset-env` is a smart preset that allows you to use the latest JavaScript without ... we recommend using a .browserslistrc file to...
Read more >
Serve modern code to modern browsers for faster page loads
To use Babel to only transpile what is needed for your users, you need to: Identify which browsers you want to target. Use...
Read more >
Problem: Babel isn't compiling my code how I expected
+ presets: ['@babel/preset-env']. + }. + }. + ]. + }. } To be brief about these additions: module.rules says we can expect...
Read more >
browserslist - npm
... like Autoprefixer, Stylelint and babel-env-preset. ... using queries like last 2 versions to be free from updating versions manually.
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