From 95c12fca0a8d07a2b72d42a5a8a0530b3a51e768 Mon Sep 17 00:00:00 2001 From: Miguel Oller Date: Sun, 29 Mar 2020 01:36:42 -0400 Subject: [PATCH] [resolvers/webpack] [fix] provide config fallback Fixes #1448 --- resolvers/webpack/CHANGELOG.md | 8 +++++++- resolvers/webpack/index.js | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/resolvers/webpack/CHANGELOG.md b/resolvers/webpack/CHANGELOG.md index 78e01348e..e06203823 100644 --- a/resolvers/webpack/CHANGELOG.md +++ b/resolvers/webpack/CHANGELOG.md @@ -5,6 +5,9 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel ## Unreleased +### Fixed +- [fix] provide config fallback ([#1705], thanks [@migueloller]) + ## 0.12.0 - 2019-12-07 ### Added @@ -13,7 +16,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel ## 0.11.1 - 2019-04-13 ### Fixed -- [fix] match coreLibs after resolveSync in webpack-resolver ([#1297]) +- [fix] match coreLibs after resolveSync in webpack-resolver ([#1297], thanks [@echenley]) ## 0.11.0 - 2018-01-22 @@ -122,6 +125,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel - `interpret` configs (such as `.babel.js`). Thanks to [@gausie] for the initial PR ([#164], ages ago! 😅) and [@jquense] for tests ([#278]). +[#1705]: https://github.com/benmosher/eslint-plugin-import/pull/1705 [#1503]: https://github.com/benmosher/eslint-plugin-import/pull/1503 [#1297]: https://github.com/benmosher/eslint-plugin-import/pull/1297 [#1261]: https://github.com/benmosher/eslint-plugin-import/pull/1261 @@ -172,4 +176,6 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel [@mattkrick]: https://github.com/mattkrick [@idudinov]: https://github.com/idudinov [@keann]: https://github.com/keann +[@echenley]: https://github.com/echenley [@Aghassi]: https://github.com/Aghassi +[@migueloller]: https://github.com/migueloller diff --git a/resolvers/webpack/index.js b/resolvers/webpack/index.js index dd3fc7a38..20c594847 100644 --- a/resolvers/webpack/index.js +++ b/resolvers/webpack/index.js @@ -119,6 +119,12 @@ exports.resolve = function (source, file, settings) { } } + if (webpackConfig == null) { + webpackConfig = {} + + console.warn('No webpack configuration with a "resolve" field found. Using empty object instead') + } + log('Using config: ', webpackConfig) // externals