Babel-plugin-module-resolver: how to use autocompletion in IntelliJ/WebStorm?

Created on 7 Dec 2016  路  2Comments  路  Source: tleunen/babel-plugin-module-resolver

I use WebStorm of version 2016.3.1 , .babelrc content is

{
    "presets": [
        "react-native"
    ],
    "plugins": [
        "transform-decorators-legacy",
        ["module-resolver", {
        "root": ["./app"],
        "alias": {
          "components": "./app/components",
          "utils":"./app/utils",
          "common":"./app/common",
          "actions":"./app/actions",
          "services":"./app/services"
        }
      }]
    ]
}

when I import a file , path autocompletion does not work.Anyone can help?

Most helpful comment

See https://github.com/tleunen/babel-plugin-module-resolver#editors-autocompletion

There's a configuration to make inside webstorm/intellij to add your custom root directory. Unfortunately, this solution only work with the root configuration.

Btw, your alias config seems redundant with your root?

All 2 comments

See https://github.com/tleunen/babel-plugin-module-resolver#editors-autocompletion

There's a configuration to make inside webstorm/intellij to add your custom root directory. Unfortunately, this solution only work with the root configuration.

Btw, your alias config seems redundant with your root?

@tleunen thanks a lot

Was this page helpful?
0 / 5 - 0 ratings