fix: Don't load browserslist in block-hoist-plugin#13182
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 0e11cca:
|
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/45489/ |
| const config = loadConfig.sync({ | ||
| babelrc: false, | ||
| configFile: false, | ||
| browserslistConfigFile: false, |
There was a problem hiding this comment.
Actually we can completely avoid loadConfig.sync. I drafted some perf changes before but never come up with a PR: JLHwung@15da88e
There was a problem hiding this comment.
That would even be better! It wasn't clear to me why it was needed so I tried to work around it.
There was a problem hiding this comment.
@JLHwung are you planning to submit your changes as a PR?
There was a problem hiding this comment.
Nope, feel free to tackle it.
There was a problem hiding this comment.
seems good as temp fix then? didn't even know we had this..
nicolo-ribaudo
left a comment
There was a problem hiding this comment.
The code changes look good.
If you have time to work on it I would prefer something like what @JLHwung proposed in #13182 (comment); otherwise we can merge this and then update it in the future.
7.13.0 introduced the new option
browserslistConfigFilein #12189. The documentation specifies that the option toggles whatever babel looks for a browserslists configuration or not.This works fine, except that the
block-hoist-pluginloads a configuration without setting thebrowserslistConfigFileto false.The
block-hoist-pluginshould set thebrowserslistConfigFiletofalseto prevent babel from loading (or looking for) abrowserslistsconfig when users explicitly disabled this functionality. Theblock-hoist-pluginmakes no use of the browserslist itself, which is why the change should be fine.