Registry / devops / eslint-import-resolver-webpack

eslint-import-resolver-webpack

JSON →
library0.13.11jsnpmunverified

Webpack-aware module resolution plugin for eslint-plugin-import, version 0.13.11. Resolves import paths using a webpack configuration (webpack.config.js by default) to support custom resolve aliases, extensions, and modules. Released as part of the eslint-plugin-import ecosystem. Stable but limited to synchronous configs; async configs will break. Supports config file path, index, inline object, environment variables, and caching. Last major release in 2019; no active development, but still functional with webpack >=1.11.0 and eslint-plugin-import >=1.4.0.

npm install eslint-import-resolver-webpack
INSTALL
IMPORT
SIG · ESLINT-IMPORT-RESO
E
eslint-import-resolver-webpack
devopsjavascriptv0.13.11
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import resolver from 'eslint-import-resolver-webpack'
const resolver = require('eslint-import-resolver-webpack')
CommonJS require works as well; the package is CJS-only. No TypeScript types.
createResolver
import { createResolver } from 'eslint-import-resolver-webpack'
const { createResolver } = require('eslint-import-resolver-webpack')
CommonJS destructuring also works.
ResolverConfig
import type { ResolverConfig } from 'eslint-import-resolver-webpack'
import { ResolverConfig } from 'eslint-import-resolver-webpack'
Type only; requires TypeScript and may not be exported.

Configures eslint-plugin-import to resolve modules using Webpack aliases and extensions from a webpack configuration file.

// .eslintrc.js module.exports = { settings: { 'import/resolver': { webpack: { config: './webpack.config.js', configIndex: 0, env: { NODE_ENV: 'development' }, cache: true } } }, rules: { 'import/no-unresolved': 'error' } };
Debug
Known issues
breakingSynchronous Webpack configs only; async configs cause resolution failures.
fix
Split async parts into a separate config file or use a synchronous wrapper.
affects: >=0.1.0
deprecatedPackage is in maintenance mode with no active development; may not support future ESLint or Webpack versions.
fix
Consider migrating to eslint-import-resolver-alias or custom resolver if issues arise.
affects: >=0.13.0
gotchaMultiple webpack configurations: only first config with 'resolve' section is used by default; use 'configIndex' for selection.
fix
Specify config-index in settings to pick the desired config.
affects: >=0.1.0
gotchaEnvironment variables must be passed via the 'env' setting; process.env values are not inherited.
fix
Set env parameter in resolver config to pass required env vars.
affects: >=0.1.0
Errors
Common errors & fixes
Error: No webpack configuration found in ...
Resolver cannot locate webpack.config.js in the project root or specified path.
fix
Ensure webpack.config.js exists or provide an absolute path via the 'config' setting.
Cannot read property 'resolve' of undefined
Webpack config function returns undefined or doesn't export an object with 'resolve'.
fix
Check that webpack config exports a valid configuration object with a 'resolve' section.
TypeError: webpackConfig is not a function
Config setting is a function, but the resolver expects an object (if env not provided).
fix
Provide an 'env' setting to invoke the function, or use an object config.
Upgrade
Version history
0.13.11latest on npm
Audit
Dependencies
eslint-plugin-importrequiredpeer dependency required for resolver to work with ESLint rules
webpackrequiredpeer dependency for parsing webpack configuration
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-import-resolver-webpack — npm install eslint-import-resolver-webpack · libregistry