You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #651 Add .babelrc error to configureBabelPresetEnv and remove some deprecations (Lyrkan)
This PR was merged into the master branch.
Discussion
----------
Add .babelrc error to configureBabelPresetEnv and remove some deprecations
Since we do not configure `@babel/preset-env` if there is a `.babelrc` file (or something similar) it makes sense to add the same warning we already have for the `Encore.configureBabel()` function to `Encore.configureBabelPresetEnv()`:
> The "callback" argument of \<function\> will not be used because your app already provides an external Babel configuration (a ".babelrc" file, ".babelrc.js" file or "babel" key in "package.json
This PR also removes some deprecation that were added by #642.
We talked about them with @weaverryan and it's probably not worth removing the `useBuiltIns` and `corejs` options of `Encore.configureBabel()`:
* they are currently recommended by the flex recipe
* it allows us to document them/check them easier than with a callback
Commits
-------
5154b38 Add .babelrc warning to configureBabelPresetEnv and remove some deprecations
logger.warning(`The "${normalizedOptionKey}" option of configureBabel() will not be used because your app already provides an external Babel configuration (a ".babelrc" file, ".babelrc.js" file or "babel" key in "package.json").`);
414
410
continue;
@@ -456,6 +452,10 @@ class WebpackConfig {
456
452
thrownewError('Argument 1 to configureBabelPresetEnv() must be a callback function.');
457
453
}
458
454
455
+
if(this.doesBabelRcFileExist()){
456
+
thrownewError('The "callback" argument of configureBabelPresetEnv() will not be used because your app already provides an external Babel configuration (a ".babelrc" file, ".babelrc.js" file or "babel" key in "package.json").');
0 commit comments