eslint-import-resolver-webpack
Advanced tools
Comparing version 0.2.4 to 0.2.5
12
index.js
@@ -43,2 +43,3 @@ var findRoot = require('find-root') | ||
var configPath = get(settings, 'config') | ||
, configIndex = get(settings, 'config-index') | ||
, packageDir | ||
@@ -97,2 +98,13 @@ , extension | ||
if (Array.isArray(webpackConfig)) { | ||
if (typeof configIndex !== 'undefined' && webpackConfig.length > configIndex) { | ||
webpackConfig = webpackConfig[configIndex] | ||
} | ||
else { | ||
webpackConfig = find(webpackConfig, function findFirstWithResolve(config) { | ||
return !!config.resolve | ||
}) | ||
} | ||
} | ||
// externals | ||
@@ -99,0 +111,0 @@ if (findExternal(source, webpackConfig.externals)) return { found: true, path: null } |
{ | ||
"name": "eslint-import-resolver-webpack", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Resolve paths to dependencies, given a webpack.config.js. Plugin for eslint-plugin-import.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,2 +14,4 @@ # eslint-import-resolver-webpack | ||
If multiple webpack configurations are found the first configuration containing a resolve section will be used. Optionally, the `config-index` (zero-based) setting can be used to select a specific configuration. | ||
```yaml | ||
@@ -27,3 +29,15 @@ --- | ||
import/resolver: | ||
webpack: { config: 'webpack.dev.config.js' } | ||
webpack: | ||
config: 'webpack.dev.config.js' | ||
``` | ||
or with explicit config file name: | ||
```yaml | ||
--- | ||
settings: | ||
import/resolver: | ||
webpack: | ||
config: 'webpack.multiple.config.js' | ||
config-index: 1 # take the config at index 1 | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10059
223
42