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

.browserslistrc being ignored from @babel/preset-env #655

Closed
kylemh opened this issue Mar 31, 2020 · 10 comments
Closed

.browserslistrc being ignored from @babel/preset-env #655

kylemh opened this issue Mar 31, 2020 · 10 comments
Labels
kind: support Asking for support with something or a specific use case scope: integration Related to an integration, not necessarily to core (but could influence core) solution: can't repro An attempt to reproduce has been tried and failed solution: needs test this issue requires creating a test to assuredly close out

Comments

@kylemh
Copy link
Contributor

kylemh commented Mar 31, 2020

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
@kylemh
Copy link
Contributor Author

kylemh commented Mar 31, 2020

I couldn't figure out or prevent my project from bundling with spread operator 😢

Ended up just slapping the Babel-CLI onto the end of the build process 🙃

Would love some help fixing this.

@kylemh
Copy link
Contributor Author

kylemh commented Mar 31, 2020

boopathi/react-svg-loader#289

Ah this is the problem

@agilgur5
Copy link
Collaborator

agilgur5 commented Apr 3, 2020

@kylemh so does a .browserslistrc file work? In-line config for preset-env inside of babelrc should work, but we don't have tests for an external .browserslistrc file and I was concerned some of the path resolution might affect it.

@agilgur5 agilgur5 added solution: invalid This doesn't seem right kind: support Asking for support with something or a specific use case labels Apr 4, 2020
@agilgur5
Copy link
Collaborator

agilgur5 commented Apr 9, 2020

@kylemh following up on my previous question

@kylemh
Copy link
Contributor Author

kylemh commented Apr 9, 2020

Ill jump into this ticket and the Storybook one tomorrow! I’ve got them both saved.

@kylemh
Copy link
Contributor Author

kylemh commented Apr 11, 2020

Make it one more day... Sorry about the delay.

@kylemh
Copy link
Contributor Author

kylemh commented Apr 28, 2020

thanks a ton @agilgur5 really helping me ❤️

hoping to get back to TSDX stuff soon

@agilgur5 agilgur5 added the solution: needs test this issue requires creating a test to assuredly close out label Aug 25, 2020
@agilgur5 agilgur5 added solution: can't repro An attempt to reproduce has been tried and failed scope: integration Related to an integration, not necessarily to core (but could influence core) and removed solution: invalid This doesn't seem right labels Sep 20, 2020
@agilgur5
Copy link
Collaborator

@kylemh I manually tested a .browserslistrc while writing up #795 and can confirm it worked. Will even error out if you've got an unknown Browserslist query, typo, etc.

Probably still good to add an integration test for .browserslistrc to make sure it continues to work

@kylemh
Copy link
Contributor Author

kylemh commented Sep 20, 2020

Right, sorry for continuing to comment, but I actually closed this when I realized that this was the problem.

@agilgur5
Copy link
Collaborator

agilgur5 commented Sep 20, 2020

Yes, I realize that, but I had also asked above #655 (comment) 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: support Asking for support with something or a specific use case scope: integration Related to an integration, not necessarily to core (but could influence core) solution: can't repro An attempt to reproduce has been tried and failed solution: needs test this issue requires creating a test to assuredly close out
Projects
None yet
Development

No branches or pull requests

2 participants