Flow: How to fix import alias for Flow: !/components/layout. Required module not found

Created on 3 Jul 2017  路  3Comments  路  Source: facebook/flow

screen shot 2017-07-03 at 10 58 51 am

I have ! as alias for root folder of project using:

  "env": {
    "development": {
      "presets": ["next/babel", "flow"],
      "plugins": [
        ["babel-plugin-root-import", [
          {
            "rootPathPrefix": "!"
          }
        ]]
      ]
    },
...

Is there a way to fix this with flow?

Most helpful comment

got it working with

[options]
module.name_mapper='!'->'<PROJECT_ROOT>'

All 3 comments

If I'm not mistaking, what you're looking for is the module.name_mapper option of .flowconfig. I'm sorry I never used and suck with regex, but this is supposed to work!

@AugustinLF thanks! I'm not very good with regex either :( I'll play around and see if I get it to work.

got it working with

[options]
module.name_mapper='!'->'<PROJECT_ROOT>'
Was this page helpful?
0 / 5 - 0 ratings

Related issues

mjj2000 picture mjj2000  路  3Comments

philikon picture philikon  路  3Comments

mmollaverdi picture mmollaverdi  路  3Comments

funtaps picture funtaps  路  3Comments

ctrlplusb picture ctrlplusb  路  3Comments