Skip to content

Commit 90dedd7

Browse files
committed
resolvers/webpack/v0.5.1: hotfix for when no webpack config is found (i.e. node_modules)
1 parent 4e19197 commit 90dedd7

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Diff for: resolvers/webpack/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
55

66
## Unreleased
77

8+
## 0.5.1 - 2016-08-11
9+
### Fixed
10+
- don't throw and die if no webpack config is found
11+
812
## 0.5.0 - 2016-08-11
913
### Added
1014
- support for Webpack 2 + `module` package.json key! ([#475], thanks [@taion])

Diff for: resolvers/webpack/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ exports.resolve = function (source, file, settings) {
6161
configPath = findConfigPath(configPath, packageDir)
6262

6363
log('Config path resolved to:', configPath)
64-
webpackConfig = require(configPath)
64+
if (configPath) {
65+
webpackConfig = require(configPath)
66+
} else {
67+
log("No config path found relative to", file, "; using {}")
68+
webpackConfig = {}
69+
}
6570

6671
if (webpackConfig && webpackConfig.default) {
6772
log('Using ES6 module "default" key instead of module.exports.')

Diff for: resolvers/webpack/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-import-resolver-webpack",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"description": "Resolve paths to dependencies, given a webpack.config.js. Plugin for eslint-plugin-import.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)