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

Question #3

Closed
thales-gaddini opened this issue Apr 24, 2018 · 4 comments
Closed

Question #3

thales-gaddini opened this issue Apr 24, 2018 · 4 comments

Comments

@thales-gaddini
Copy link

thales-gaddini commented Apr 24, 2018

Hi, thanks for the plugin!

I wanted to know if the plugin accepts something like this?

module.exports = {
  "settings": {
    "import/resolver": {
      "alias": [
        ["apis/*", "./app/apis/*"],
        ["constants/*", "./app/constants/*"],
        ["state/*", "./app/state/*"],
        ["utilities/*", "./app/utilities/*"],
      ]
    }
  }
}

If yes, do you know why I'm having trouble with that configuration? If no, think this could be an enhancement?

Thanks again!

@johvin
Copy link
Owner

johvin commented Apr 25, 2018

@thales-gaddini The answer is yes. You can achieve the goal with the following configuration.

module.exports = {
  "settings": {
    "import/resolver": {
      "alias": [
        ["apis", "./app/apis"],
        ["constants", "./app/constants"],
        ["state", "./app/state"],
        ["utilities", "./app/utilities"],
      ]
    }
  }
}

@johvin
Copy link
Owner

johvin commented Jul 30, 2018

@thales-gaddini I feel so sorry that I have just realized I misled you about this issue. The configuration is right, but there's a bug(#5) with the plugin which led to your trouble. The bug has been fixed now and you will get what you want by upgrading its version to 1.1.1. Sorry for that again.

@johvin johvin added the fixed label Jul 30, 2018
@julien-amblard
Copy link

julien-amblard commented Jan 9, 2019

Hello, did this bugfix still is in 1.1.2 version ?
i have the same issue, i can't create alias for subfolders

in my case, this work :

module.exports = {
    settings: {
        'import/resolver': {
            alias: {
                map: [
                    ['^Client', './client']
                ],
                extensions: ['.js', '.jsx', '.json']
            }
        }
    }
};

this don't :

module.exports = {
    settings: {
        'import/resolver': {
            alias: {
                map: [
                    ['^Components', './client/components']
                ],
                extensions: ['.js', '.jsx', '.json']
            }
        }
    }
};

Thank you !

@johvin
Copy link
Owner

johvin commented Jan 14, 2019

@seloger-AmblardJulien Can you provide the simplified source code and file structure of your project to help me to reproduce the problem better.

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

No branches or pull requests

3 participants