Commit graph

2 commits

Author SHA1 Message Date
Steven
cff9fc9d74
BREAKING CHANGE: Remove browsersListForSwc and change default to legacyBrowsers: false (#41529)
Remove `browsersListForSwc` since it is enabled by default now, and disable `legacyBrowsers` by default.

This PR also bumps the default browserslist to the following:

- Chrome 64+
- Edge 79+
- Firefox 67+
- Opera 51+
- Safari 12+

See related RFC:
- Closes #33227 

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-10-19 01:38:39 +00:00
Tim Neutkens
fe3d6b7aed
Add support for browserslist and legacyBrowsers experimental option (#36584)
Implements the first part of #33227

- Applies browserslist to JS transforms when `experimental.browsersListForSwc` is enabled. 
- You don't have to use browserslist, there's also `legacyBrowsers: false` which will be the new default in Next.js 13. See #33227 for which browsers and why. `legacyBrowsers` requires `browsersListForSwc: true` to function until it is the default. 

```js
module.exports = {
  experimental: {
    legacyBrowsers: false,
    browsersListForSwc: true,
  }
}
```

I only implemented the JS part of the RFC, the CSS part should be handled in a follow-up PR.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [x] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-05-17 15:09:34 +00:00