Skip to content

Commit

Permalink
resolvers/webpack/v0.5.1: hotfix for when no webpack config is found …
Browse files Browse the repository at this point in the history
…(i.e. node_modules)
  • Loading branch information
benmosher committed Aug 11, 2016
1 parent 4e19197 commit 90dedd7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions resolvers/webpack/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel

## Unreleased

## 0.5.1 - 2016-08-11
### Fixed
- don't throw and die if no webpack config is found

## 0.5.0 - 2016-08-11
### Added
- support for Webpack 2 + `module` package.json key! ([#475], thanks [@taion])
Expand Down
7 changes: 6 additions & 1 deletion resolvers/webpack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ exports.resolve = function (source, file, settings) {
configPath = findConfigPath(configPath, packageDir)

log('Config path resolved to:', configPath)
webpackConfig = require(configPath)
if (configPath) {
webpackConfig = require(configPath)
} else {
log("No config path found relative to", file, "; using {}")
webpackConfig = {}
}

if (webpackConfig && webpackConfig.default) {
log('Using ES6 module "default" key instead of module.exports.')
Expand Down
2 changes: 1 addition & 1 deletion resolvers/webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-import-resolver-webpack",
"version": "0.5.0",
"version": "0.5.1",
"description": "Resolve paths to dependencies, given a webpack.config.js. Plugin for eslint-plugin-import.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 90dedd7

Please sign in to comment.