Skip to content

Commit 3abf767

Browse files
committed
Improve error and warning messages for external Babel configuration in configureBabel() and configureBabelPresetEnv()
1 parent a42a092 commit 3abf767

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/config-generator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class ConfigGenerator {
164164
// Check from configureBabel(): if a callback was provided and an
165165
// external Babel config exists, that's an error.
166166
if (this.webpackConfig._configureBabelCalled && babelRcFileExists) {
167-
throw new Error('The "callback" argument of configureBabel() will not be used because your app already provides an external Babel configuration (e.g. a ".babelrc" or "babel.config.js" file or "babel" key in "package.json"). Use null as the first argument to remove this error.');
167+
throw new Error('The "callback" argument of configureBabel() will not be used because your app already provides an external Babel configuration (e.g. a "babel.config.js" file or "babel" key in "package.json"). Use null as the first argument to remove this error.');
168168
}
169169

170170
// Check from configureBabel(): warn about options that won't be applied
@@ -174,15 +174,15 @@ class ConfigGenerator {
174174
if (babelRcFileExists) {
175175
for (const optionKey of Object.keys(configureOptions)) {
176176
if (!allowedOptionsWithExternalConfig.includes(optionKey)) {
177-
logger.warning(`The "${optionKey}" option of configureBabel() will not be used because your app already provides an external Babel configuration (e.g. a ".babelrc" or "babelrc.config.js" file or "babel" key in "package.json").`);
177+
logger.warning(`The "${optionKey}" option of configureBabel() will not be used because your app already provides an external Babel configuration (e.g. a "babel.config.js" file or "babel" key in "package.json").`);
178178
}
179179
}
180180
}
181181

182182
// Check from configureBabelPresetEnv(): if configureBabelPresetEnv()
183183
// was called and an external Babel config exists, that's an error.
184184
if (this.webpackConfig._configureBabelPresetEnvCalled && babelRcFileExists) {
185-
throw new Error('The "callback" argument of configureBabelPresetEnv() will not be used because your app already provides an external Babel configuration (e.g. a ".babelrc" or "babel.config.js" file or "babel" key in "package.json").');
185+
throw new Error('The "callback" argument of configureBabelPresetEnv() will not be used because your app already provides an external Babel configuration (e.g. a "babel.config.js" file or "babel" key in "package.json").');
186186
}
187187
}
188188

0 commit comments

Comments
 (0)