Skip to content

Commit bc1d025

Browse files
committed
chore(cr): more user-friendly error for valid configurable loaders
1 parent 01880cf commit bc1d025

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/WebpackConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ class WebpackConfig {
721721

722722
configureLoaderRule(name, callback) {
723723
if (!(name in this.loaderConfigurationCallbacks)) {
724-
throw new Error(`Loader "${name}" is not configurable. Either open an issue or a pull request.`);
724+
throw new Error(`Loader "${name}" is not configurable. Valid loaders are "${Object.keys(this.loaderConfigurationCallbacks).join('", "')}".`);
725725
}
726726

727727
if (typeof callback !== 'function') {

test/WebpackConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ describe('WebpackConfig object', () => {
11611161

11621162
expect(() => {
11631163
config.configureLoaderRule('vue');
1164-
}).to.throw('Loader "vue" is not configurable. Either open an issue or a pull request.');
1164+
}).to.throw('Loader "vue" is not configurable. Valid loaders are "eslint".');
11651165
});
11661166

11671167
it('Call method with not a valid callback', () => {

0 commit comments

Comments
 (0)