Babel-plugin-module-resolver: my path resolutions are adding two dots in front instead of one ".."

Created on 8 Aug 2020  路  3Comments  路  Source: tleunen/babel-plugin-module-resolver

my config:

    [
      "babel-plugin-module-resolver",
      {
        "root": ["./src"],
        "alias": {
          "components": "./components",
          "constants": "./constants",
          "containers": "./containers",
          "layout": "./layout",
          "models": "./models",
          "modules": "./modules",
          "routes": "./routes",
          "static": "./static",
          "store": "./store",
          "types": "./types",
          "utils": "./utils"
        }
      }
    ]

please just tell me i did a dumb. I am at the end of my rope.

from the index.tsx, import App from 'containers/App' becomes import App from '../containers/App'

it should just be a single . not ..

Most helpful comment

don't use root, just add ./src/ to all path,

"components": "./src/components"

All 3 comments

same, version 4.0.0

don't use root, just add ./src/ to all path,

"components": "./src/components"

don't use root, just add ./src/ to all path,

"components": "./src/components"

thx! it was useful for me

Was this page helpful?
0 / 5 - 0 ratings