Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document "env" option for eslint-import-resolver-webpack #1258

Closed
linvain opened this issue Jan 14, 2019 · 2 comments · Fixed by #1363
Closed

Document "env" option for eslint-import-resolver-webpack #1258

linvain opened this issue Jan 14, 2019 · 2 comments · Fixed by #1363

Comments

@linvain
Copy link

linvain commented Jan 14, 2019

I use env variable in my webpack config:

module.exports = function (env) {
    ...
}

This leads to a hell of errors:

Resolve error: Cannot read property 'production' of undefined

The issue can be resolved by adding env option to resolver settings:

  "settings": {
    "import/resolver": {
      "webpack": {
        "env": "development"
      }
    }
  }

But this is not documented.
P.S.: Thanks @VladimirPal (#1043)

@linvain linvain changed the title Document "env" option to eslint-import-resolver-webpack Document "env" option for eslint-import-resolver-webpack Jan 14, 2019
ljharb added a commit that referenced this issue May 16, 2019
Merge pull request #1363 from kgregory/webpack-resolver-doc-env

Fixes #1258.
@brycekunkel
Copy link

@linvain / @ljharb , I know this is closed, but before I file a new issue, is there a way to acknowledge that environment variables exist, but not set their value? Maybe I'm misunderstanding how to use that config. My complex webpack setup allows the user to pass in additional options on the command line, but it throws all kinds of errors as were mentioned in the beginning of this issue.

@ljharb
Copy link
Member

ljharb commented Oct 6, 2022

I think that you might need to have a JS-based config that reads those command-line values :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants